Re: [Qemu-block] [PATCH] nbd: Don't inf-loop on early EOF

2016-11-07 Thread Eric Blake
On 11/07/2016 04:22 PM, Max Reitz wrote: > On 07.11.2016 21:38, Eric Blake wrote: >> Commit 7d3123e converted a single read_sync() into a while loop >> that assumed that read_sync() would either make progress or give >> an error. But when the server hangs up early, the client sees >> EOF (a

Re: [Qemu-block] [Qemu-devel] [PATCH v2 2/6] libqtest: add qmp_eventwait_ref

2016-11-07 Thread Eric Blake
On 11/07/2016 03:13 PM, John Snow wrote: > Wait for an event, but return a copy so we can investigate parameters. > > Signed-off-by: John Snow > --- > tests/libqtest.c | 13 ++--- > tests/libqtest.h | 22 ++ > 2 files changed, 32 insertions(+), 3

[Qemu-block] [PATCH v2 4/6] libqos/ahci: Add ATAPI tray macros

2016-11-07 Thread John Snow
(1) Add START_STOP_UNIT command to ahci-test suite (2) Add eject/start macro commands; this is not a data transfer command so it is not well-served by the existing generic pipeline. Signed-off-by: John Snow --- tests/libqos/ahci.c | 30 ++

[Qemu-block] [PATCH v2 3/6] libqos/ahci: Support expected errors

2016-11-07 Thread John Snow
Sometimes we know we'll get back an error, so let's have the test framework understand that. Signed-off-by: John Snow --- tests/libqos/ahci.c | 16 tests/libqos/ahci.h | 3 ++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git

[Qemu-block] [PATCH v2 0/6] block-backend: Always notify on blk_eject

2016-11-07 Thread John Snow
Requires patches in my IDE branch, for context. This series changes blk_eject (used for a software-initiated eject request) to always trigger a QMP tray event, in contrast to the current behavior where a tray event only occurs if a medium is already in the tray. V2: Now with tests. (Kevin)

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.8] block: Don't mark node clean after failed flush

2016-11-07 Thread John Snow
On 11/04/2016 07:03 PM, Kevin Wolf wrote: Commit 3ff2f67a changed bdrv_co_flush() so that no flush is issues if the image hasn't been dirtied since the last flush. This is not quite correct: The condition should be that the image hasn't been dirtied since the last _successful_ flush. This

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/6] block-backend: Always notify on blk_eject

2016-11-07 Thread Eric Blake
On 11/07/2016 03:13 PM, John Snow wrote: > blk_eject is only used by scsi-disk and atapi, and in both cases we > only attempt to invoke blk_eject if we have a bona-fide change in > tray state. > > The "issue" here is that the tray state does not generate a QMP event > unless there is a medium/BDS

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.8] nbd: Don't inf-loop on early EOF

2016-11-07 Thread Eric Blake
[updating subject line, to make sure this regression is fixed] On 11/07/2016 02:38 PM, Eric Blake wrote: > Commit 7d3123e converted a single read_sync() into a while loop > that assumed that read_sync() would either make progress or give > an error. But when the server hangs up early, the client

[Qemu-block] [PATCH v2 6/6] ahci-test: add QMP tray test for ATAPI

2016-11-07 Thread John Snow
Test QMP events for a CDROM device with or without a media inserted, including both guest-initiated and hw-initiated eject/load requests. Signed-off-by: John Snow --- tests/ahci-test.c | 98 +++ 1 file changed, 98

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.8? 0/3] block/curl: Drop TFTP "support"

2016-11-07 Thread Markus Armbruster
Max Reitz writes: > On 03.11.2016 08:56, Markus Armbruster wrote: >> Max Reitz writes: >> >>> See patch 3 for the reason why we have actually never supported TFTP at >>> all (except for very small files (i.e. below 256 kB or so)). >> >> Care to explain

Re: [Qemu-block] [Qemu-devel] [PATCH] docs/block-replication.txt: Introduce nbd qmp commands

2016-11-07 Thread Changlong Xie
On 11/07/2016 03:50 PM, Markus Armbruster wrote: Changlong Xie writes: Signed-off-by: Changlong Xie --- docs/block-replication.txt | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git

Re: [Qemu-block] [PATCH v3 1/6] blockjob: fix dead pointer in txn list

2016-11-07 Thread Jeff Cody
On Wed, Nov 02, 2016 at 01:50:51PM -0400, John Snow wrote: > From: Vladimir Sementsov-Ogievskiy > > Though it is not intended to be reached through normal circumstances, > if we do not gracefully deconstruct the transaction QLIST, we may wind > up with stale pointers in

[Qemu-block] [PATCH v4 5/6] blockjob: refactor backup_start as backup_job_create

2016-11-07 Thread John Snow
Refactor backup_start as backup_job_create, which only creates the job, but does not automatically start it. The old interface, 'backup_start', is not kept in favor of limiting the number of nearly-identical interfaces that would have to be edited to keep up with QAPI changes in the future.

Re: [Qemu-block] [Qemu-devel] [PATCH v3 5/6] blockjob: refactor backup_start as backup_job_create

2016-11-07 Thread John Snow
On 11/03/2016 09:17 AM, Kevin Wolf wrote: Am 02.11.2016 um 18:50 hat John Snow geschrieben: Refactor backup_start as backup_job_create, which only creates the job, but does not automatically start it. The old interface, 'backup_start', is not kept in favor of limiting the number of

[Qemu-block] [PATCH v4 4/6] blockjob: add block_job_start

2016-11-07 Thread John Snow
Instead of automatically starting jobs at creation time via backup_start et al, we'd like to return a job object pointer that can be started manually at later point in time. For now, add the block_job_start mechanism and start the jobs automatically as we have been doing, with conversions

[Qemu-block] [PATCH v4 0/6] jobs: fix transactional race condition

2016-11-07 Thread John Snow
There are a few problems with transactional job completion right now. First, if jobs complete so quickly they complete before remaining jobs get a chance to join the transaction, the completion mode can leave well known state and the QLIST can get corrupted and the transactional jobs can complete

[Qemu-block] [PATCH v4 1/6] blockjob: fix dead pointer in txn list

2016-11-07 Thread John Snow
From: Vladimir Sementsov-Ogievskiy Though it is not intended to be reached through normal circumstances, if we do not gracefully deconstruct the transaction QLIST, we may wind up with stale pointers in the list. The rest of this series attempts to address the

[Qemu-block] [PATCH v4 3/6] blockjob: add .start field

2016-11-07 Thread John Snow
Add an explicit start field to specify the entrypoint. We already have ownership of the coroutine itself AND managing the lifetime of the coroutine, let's take control of creation of the coroutine, too. This will allow us to delay creation of the actual coroutine until we know we'll actually

[Qemu-block] [PATCH v4 2/6] blockjob: add .clean property

2016-11-07 Thread John Snow
Cleaning up after we have deferred to the main thread but before the transaction has converged can be dangerous and result in deadlocks if the job cleanup invokes any BH polling loops. A job may attempt to begin cleaning up, but may induce another job to enter its cleanup routine. The second job,

[Qemu-block] [PATCH v4 6/6] iotests: add transactional failure race test

2016-11-07 Thread John Snow
Add a regression test for the case found by Vladimir. Reported-by: Vladimir Sementsov-Ogievskiy Signed-off-by: John Snow Reviewed-by: Kevin Wolf --- tests/qemu-iotests/124 | 53 ++

[Qemu-block] [RFC v2] RBD: Add support readv,writev for rbd

2016-11-07 Thread jazeltq
From: tianqing Rbd can do readv and writev directly, so wo do not need to transform iov to buf or vice versa any more. Signed-off-by: tianqing --- block/rbd.c | 41 - 1 file changed, 36 insertions(+),

Re: [Qemu-block] [PATCH 1/2] aio-posix: avoid NULL pointer dereference in aio_epoll_update

2016-11-07 Thread Stefan Hajnoczi
On Mon, Nov 07, 2016 at 10:33:33AM +0100, Paolo Bonzini wrote: > aio_epoll_update dereferences parameter "node", but it could have been NULL > if deleting an fd handler that was not registered in the first place. > > Signed-off-by: Paolo Bonzini > --- > aio-posix.c | 33

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.8? 0/3] block/curl: Drop TFTP "support"

2016-11-07 Thread Max Reitz
On 07.11.2016 09:20, Markus Armbruster wrote: > Max Reitz writes: > >> On 03.11.2016 08:56, Markus Armbruster wrote: >>> Max Reitz writes: >>> See patch 3 for the reason why we have actually never supported TFTP at all (except for very small files

Re: [Qemu-block] [PATCH 1/2] aio-posix: avoid NULL pointer dereference in aio_epoll_update

2016-11-07 Thread Paolo Bonzini
On 07/11/2016 15:58, Stefan Hajnoczi wrote: > On Mon, Nov 07, 2016 at 10:33:33AM +0100, Paolo Bonzini wrote: >> aio_epoll_update dereferences parameter "node", but it could have been NULL >> if deleting an fd handler that was not registered in the first place. >> >> Signed-off-by: Paolo Bonzini

Re: [Qemu-block] [PATCH for-2.8? 0/3] block/curl: Drop TFTP "support"

2016-11-07 Thread Stefan Hajnoczi
On Wed, Nov 02, 2016 at 06:55:36PM +0100, Max Reitz wrote: > See patch 3 for the reason why we have actually never supported TFTP at > all (except for very small files (i.e. below 256 kB or so)). I agree with dropping TFTP from the curl block driver but for the record: TFTP is not good for large

Re: [Qemu-block] [PATCH for-2.8] block: Don't mark node clean after failed flush

2016-11-07 Thread Stefan Hajnoczi
On Sat, Nov 05, 2016 at 12:03:15AM +0100, Kevin Wolf wrote: > Commit 3ff2f67a changed bdrv_co_flush() so that no flush is issues if > the image hasn't been dirtied since the last flush. This is not quite > correct: The condition should be that the image hasn't been dirtied > since the last

Re: [Qemu-block] [PATCH 2/2] aio-posix: simplify aio_epoll_update

2016-11-07 Thread Stefan Hajnoczi
On Mon, Nov 07, 2016 at 10:33:34AM +0100, Paolo Bonzini wrote: > Extract common code out of the "if". > > Signed-off-by: Paolo Bonzini > --- > aio-posix.c | 23 --- > 1 file changed, 8 insertions(+), 15 deletions(-) Reviewed-by: Stefan Hajnoczi

[Qemu-block] BdrvDirtyBitmap and bdrv_snapshot_goto

2016-11-07 Thread Vladimir Sementsov-Ogievskiy
Hi all! As I can see, in bdrv_snapshot_goto, existing dirty bitmaps are not handled.. Is it ok? Should not they be filled with ones or something like this? Also, when we will have persistent bitmaps in qcow2, haw they should be handled on snapshot switching? -- Best regards, Vladimir

Re: [Qemu-block] [PATCH v3 3/6] blockjob: add .start field

2016-11-07 Thread Jeff Cody
On Wed, Nov 02, 2016 at 01:50:53PM -0400, John Snow wrote: > Add an explicit start field to specify the entrypoint. We already have > ownership of the coroutine itself AND managing the lifetime of the > coroutine, let's take control of creation of the coroutine, too. > > This will allow us to

Re: [Qemu-block] [Qemu-devel] [PATCH v3 4/6] blockjob: add block_job_start

2016-11-07 Thread Jeff Cody
On Mon, Nov 07, 2016 at 09:02:14PM -0500, John Snow wrote: > > > On 11/03/2016 08:17 AM, Kevin Wolf wrote: > >Am 02.11.2016 um 18:50 hat John Snow geschrieben: > >>Instead of automatically starting jobs at creation time via backup_start > >>et al, we'd like to return a job object pointer that

Re: [Qemu-block] [Qemu-devel] [PATCH v3 4/6] blockjob: add block_job_start

2016-11-07 Thread John Snow
On 11/07/2016 09:05 PM, Jeff Cody wrote: On Mon, Nov 07, 2016 at 09:02:14PM -0500, John Snow wrote: On 11/03/2016 08:17 AM, Kevin Wolf wrote: Am 02.11.2016 um 18:50 hat John Snow geschrieben: Instead of automatically starting jobs at creation time via backup_start et al, we'd like to

Re: [Qemu-block] [PATCH v3 5/6] blockjob: refactor backup_start as backup_job_create

2016-11-07 Thread Jeff Cody
On Wed, Nov 02, 2016 at 01:50:55PM -0400, John Snow wrote: > Refactor backup_start as backup_job_create, which only creates the job, > but does not automatically start it. The old interface, 'backup_start', > is not kept in favor of limiting the number of nearly-identical interfaces > that would

Re: [Qemu-block] [Qemu-devel] [PATCH v3 4/6] blockjob: add block_job_start

2016-11-07 Thread John Snow
On 11/03/2016 08:17 AM, Kevin Wolf wrote: Am 02.11.2016 um 18:50 hat John Snow geschrieben: Instead of automatically starting jobs at creation time via backup_start et al, we'd like to return a job object pointer that can be started manually at later point in time. For now, add the

Re: [Qemu-block] [PATCH v3 2/6] blockjob: add .clean property

2016-11-07 Thread Jeff Cody
On Wed, Nov 02, 2016 at 01:50:52PM -0400, John Snow wrote: > Cleaning up after we have deferred to the main thread but before the > transaction has converged can be dangerous and result in deadlocks > if the job cleanup invokes any BH polling loops. > > A job may attempt to begin cleaning up, but

Re: [Qemu-block] [PATCH for-2.8] nfs: Fix memory leak in nfs_file_create()

2016-11-07 Thread Stefan Hajnoczi
On Mon, Nov 07, 2016 at 10:31:29AM +0100, Kevin Wolf wrote: > The leak was introduced in commit 94d6a7a7. > > Signed-off-by: Kevin Wolf > --- > block/nfs.c | 1 + > 1 file changed, 1 insertion(+) Reviewed-by: Stefan Hajnoczi signature.asc Description:

Re: [Qemu-block] [Qemu-devel] BdrvDirtyBitmap and bdrv_snapshot_goto

2016-11-07 Thread Max Reitz
On 07.11.2016 16:24, Vladimir Sementsov-Ogievskiy wrote: > Hi all! > > As I can see, in bdrv_snapshot_goto, existing dirty bitmaps are not > handled.. Is it ok? Should not they be filled with ones or something > like this? Filling them with ones makes sense to me. I guess nobody noticed because

Re: [Qemu-block] [PATCH 12/22] qcow2-bitmap: add IN_USE flag

2016-11-07 Thread Vladimir Sementsov-Ogievskiy
25.10.2016 13:53, Vladimir Sementsov-Ogievskiy wrote: 24.10.2016 20:18, Max Reitz wrote: On 24.10.2016 19:08, Max Reitz wrote: On 24.10.2016 13:35, Vladimir Sementsov-Ogievskiy wrote: 24.10.2016 13:32, Vladimir Sementsov-Ogievskiy пишет: 21.10.2016 22:58, Max Reitz пишет: On 21.10.2016

Re: [Qemu-block] [PATCH 12/22] qcow2-bitmap: add IN_USE flag

2016-11-07 Thread Max Reitz
On 07.11.2016 17:12, Vladimir Sementsov-Ogievskiy wrote: > 25.10.2016 13:53, Vladimir Sementsov-Ogievskiy wrote: >> 24.10.2016 20:18, Max Reitz wrote: >>> On 24.10.2016 19:08, Max Reitz wrote: On 24.10.2016 13:35, Vladimir Sementsov-Ogievskiy wrote: > 24.10.2016 13:32, Vladimir

[Qemu-block] [PATCH for-2.8] hbitmap: Fix the serialization granularity's type

2016-11-07 Thread Max Reitz
This function returns a uint64_t, so it should not truncate its result by performing a plain int calculation. Signed-off-by: Max Reitz --- util/hbitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/hbitmap.c b/util/hbitmap.c index 5d1a21c..c57be76

Re: [Qemu-block] [PATCH] MAINTAINERS: Add Fam and Jsnow for Bitmap support

2016-11-07 Thread Max Reitz
On 04.08.2016 20:18, John Snow wrote: > These files are currently unmaintained. > > I'm proposing that Fam and I co-maintain them; under the model that > whomever between us isn't authoring a given series will be responsible > for reviewing it. > > Signed-off-by: John Snow >

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.8 0/2] aio-posix: epoll cleanups

2016-11-07 Thread Fam Zheng
On Mon, 11/07 10:33, Paolo Bonzini wrote: > The first fixes a NULL-pointer dereference that was reported by > Coverity (so definitely for 2.8). The second is a small simplification. > > Paolo Bonzini (2): > aio-posix: avoid NULL pointer dereference in aio_epoll_update > aio-posix: simplify

Re: [Qemu-block] [PATCH] Added iopmem device emulation

2016-11-07 Thread Stefan Hajnoczi
On Fri, Nov 04, 2016 at 09:47:33AM -0600, Logan Gunthorpe wrote: > On 04/11/16 04:49 AM, Stefan Hajnoczi wrote: > > QEMU already has NVDIMM support (https://pmem.io/). It can be used both > > for passthrough and fake non-volatile memory: > > > > qemu-system-x86_64 \ > > -M pc,nvdimm=on \ >

[Qemu-block] [PATCH for-2.8] nfs: Fix memory leak in nfs_file_create()

2016-11-07 Thread Kevin Wolf
The leak was introduced in commit 94d6a7a7. Signed-off-by: Kevin Wolf --- block/nfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/nfs.c b/block/nfs.c index 55c4e0b..d082783 100644 --- a/block/nfs.c +++ b/block/nfs.c @@ -676,6 +676,7 @@ static int

[Qemu-block] [PATCH 2/2] aio-posix: simplify aio_epoll_update

2016-11-07 Thread Paolo Bonzini
Extract common code out of the "if". Signed-off-by: Paolo Bonzini --- aio-posix.c | 23 --- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/aio-posix.c b/aio-posix.c index ec908f7..d54553d 100644 --- a/aio-posix.c +++ b/aio-posix.c @@

[Qemu-block] [PATCH 1/2] aio-posix: avoid NULL pointer dereference in aio_epoll_update

2016-11-07 Thread Paolo Bonzini
aio_epoll_update dereferences parameter "node", but it could have been NULL if deleting an fd handler that was not registered in the first place. Signed-off-by: Paolo Bonzini --- aio-posix.c | 33 ++--- 1 file changed, 18 insertions(+), 15