Re: [Qemu-block] [Qemu-devel] [PATCH] qcow2: allocate cluster_cache/cluster_data on demand

2017-08-30 Thread Alexey Kardashevskiy
On 31/08/17 03:20, Stefan Hajnoczi wrote: > On Tue, Aug 22, 2017 at 02:56:00PM +1000, Alexey Kardashevskiy wrote: >> On 19/08/17 12:46, Alexey Kardashevskiy wrote: >>> On 19/08/17 01:18, Eric Blake wrote: On 08/18/2017 08:31 AM, Stefan Hajnoczi wrote: > Most qcow2 files are uncompressed

Re: [Qemu-block] [Qemu-devel] [PATCH v2 7/9] AHCI: Rework IRQ constants

2017-08-30 Thread John Snow
On 08/29/2017 11:54 PM, Philippe Mathieu-Daudé wrote: > On 08/29/2017 05:49 PM, John Snow wrote: >> Create a new enum so that we can name the IRQ bits, which will make >> debugging >> them a little nicer if we can print them out. Not handled in this >> patch, but >> this will make it possible to

Re: [Qemu-block] [Qemu-devel] [PATCH v2 5/9] IDE: replace DEBUG_AIO with trace events

2017-08-30 Thread John Snow
CCing Laszlo Ersek literally just for laughs, as he is the most entertaining language lawyer I know of. Laszlo, please feel free to ignore this if you don't care :P On 08/29/2017 11:14 PM, Philippe Mathieu-Daudé wrote: > Hi John, > > On 08/29/2017 05:49 PM, John Snow wrote: >> Signed-off-by:

Re: [Qemu-block] [Qemu-devel] [PATCH v2 8/9] AHCI: pretty-print FIS to buffer instead of stderr

2017-08-30 Thread John Snow
On 08/30/2017 05:17 AM, Stefan Hajnoczi wrote: > On Tue, Aug 29, 2017 at 04:49:33PM -0400, John Snow wrote: >> The current FIS printing routines dump the FIS to screen. adjust this >> such that it dumps to buffer instead, then use this ability to have >> FIS dump mechanisms via trace-events

Re: [Qemu-block] [Qemu-devel] [PATCH v6 00/18] make dirty-bitmap byte-based

2017-08-30 Thread John Snow
On 08/30/2017 05:05 PM, Eric Blake wrote: > There are patches floating around to add NBD_CMD_BLOCK_STATUS, > but NBD wants to report status on byte granularity (even if the > reporting will probably be naturally aligned to sectors or even > much higher levels). I've therefore started the task

Re: [Qemu-block] [Qemu-devel] [PATCH v3 1/5] qemu-iotests: set TEST_DIR to a unique dir for each test

2017-08-30 Thread Jeff Cody
On Wed, Aug 30, 2017 at 06:15:05PM -0400, John Snow wrote: > > > On 08/30/2017 12:52 PM, Jeff Cody wrote: > > Right now, all qemu-iotests output data into the same scratch directory, > > and so each test needs to be responsible for cleaning up its own files. > > > > Have each test use

Re: [Qemu-block] [Qemu-devel] [PATCH v3 5/5] qemu-iotests: add option to save temp files on error

2017-08-30 Thread John Snow
On 08/30/2017 12:52 PM, Jeff Cody wrote: > Now that ./check takes care of cleaning up after each tests, it > can also selectively not clean up. Add option to leave all output from > tests intact if that test encountered an error. > > Note: this currently only works for bash tests, as the

Re: [Qemu-block] [Qemu-devel] [PATCH v3 4/5] qemu-iotests: make python tests attempt to leave intermediate files

2017-08-30 Thread Eric Blake
On 08/30/2017 05:28 PM, John Snow wrote: > I'm a little iffy on this patch; I know that ./check can take care of > our temp files for us now, but because each python test is itself a > little mini-harness, I'm a little leery of moving the teardown to setup > and trying to pre-clean the confetti

Re: [Qemu-block] [Qemu-devel] [PATCH v3 4/5] qemu-iotests: make python tests attempt to leave intermediate files

2017-08-30 Thread John Snow
On 08/30/2017 02:33 PM, Eric Blake wrote: > On 08/30/2017 11:52 AM, Jeff Cody wrote: >> Now that 'check' will clean up after tests, try and make python >> tests leave intermediate files so that they might be inspectable >> on failure. >> >> This isn't perfect; the python unittest framework runs

Re: [Qemu-block] [Qemu-devel] [PATCH v3 3/5] qemu-iotests: add 'blind_remove' for python tests

2017-08-30 Thread John Snow
On 08/30/2017 02:13 PM, Eric Blake wrote: > On 08/30/2017 11:52 AM, Jeff Cody wrote: >> Add a function to attempt to 'blindly' remove a file, without >> throwing an error if the file doesn't exist. >> >> Signed-off-by: Jeff Cody >> --- >> tests/qemu-iotests/iotests.py | 7

Re: [Qemu-block] [Qemu-devel] [PATCH v3 2/5] qemu-iotests: remove file cleanup from bash tests

2017-08-30 Thread John Snow
On 08/30/2017 12:52 PM, Jeff Cody wrote: > All files for a given test are now self-contained in a subdirectory, > and therefore the "./check" script can do all file-related cleanup > without any help. > > This removes file cleanups from the bash tests. The only cleanup left > is whatever is

Re: [Qemu-block] [Qemu-devel] [PATCH v3 1/5] qemu-iotests: set TEST_DIR to a unique dir for each test

2017-08-30 Thread John Snow
On 08/30/2017 12:52 PM, Jeff Cody wrote: > Right now, all qemu-iotests output data into the same scratch directory, > and so each test needs to be responsible for cleaning up its own files. > > Have each test use 'scratch/$seq' as its temp directory, so the check > script can do simple cleanup

[Qemu-block] [PATCH v2 13/17] MAINTAINERS: add missing AIO entry

2017-08-30 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé Acked-by: Fam Zheng Reviewed-by: Stefan Hajnoczi --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 20d65dca73..a48f633cad 100644 --- a/MAINTAINERS +++

[Qemu-block] [PATCH v2 17/17] MAINTAINERS: update docs/interop/ entries

2017-08-30 Thread Philippe Mathieu-Daudé
moved in commit 7746cf8aab68 Signed-off-by: Philippe Mathieu-Daudé Acked-by: Fam Zheng Acked-by: John Snow --- MAINTAINERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index

[Qemu-block] [PATCH v2 07/17] MAINTAINERS: add missing qcow2 entry

2017-08-30 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé Acked-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index f4e07173c8..eb20365fbb 100644 --- a/MAINTAINERS

Re: [Qemu-block] [Qemu-devel] Persistent bitmaps for non-qcow2 formats

2017-08-30 Thread John Snow
On 08/30/2017 08:58 AM, Yaniv Lavi (Dary) wrote: > > > We had no reason to switch to anything else so far and I'm sure this > option was not available when we started supporting raw format. > > Yeah, they don't exist yet...! I've looped you in to see if the proposal being discussed would

[Qemu-block] [PATCH v6 15/18] qcow2: Switch load_bitmap_data() to byte-based iteration

2017-08-30 Thread Eric Blake
Now that we have adjusted the majority of the calls this function makes to be byte-based, it is easier to read the code if it makes passes over the image using bytes rather than sectors. Signed-off-by: Eric Blake Reviewed-by: John Snow Reviewed-by: Vladimir

[Qemu-block] [PATCH v6 18/18] dirty-bitmap: Convert internal hbitmap size/granularity

2017-08-30 Thread Eric Blake
Now that all callers are using byte-based interfaces, there's no reason for our internal hbitmap to remain with sector-based granularity. It also simplifies our internal scaling, since we already know that hbitmap widens requests out to granularity boundaries. Signed-off-by: Eric Blake

[Qemu-block] [PATCH v6 13/18] mirror: Switch mirror_dirty_init() to byte-based iteration

2017-08-30 Thread Eric Blake
Now that we have adjusted the majority of the calls this function makes to be byte-based, it is easier to read the code if it makes passes over the image using bytes rather than sectors. Signed-off-by: Eric Blake Reviewed-by: John Snow --- v6: no change v5:

[Qemu-block] [PATCH v6 12/18] dirty-bitmap: Change bdrv_[re]set_dirty_bitmap() to use bytes

2017-08-30 Thread Eric Blake
Some of the callers were already scaling bytes to sectors; others can be easily converted to pass byte offsets, all in our shift towards a consistent byte interface everywhere. Making the change will also make it easier to write the hold-out callers to use byte rather than sectors for their

[Qemu-block] [PATCH v6 17/18] dirty-bitmap: Switch bdrv_set_dirty() to bytes

2017-08-30 Thread Eric Blake
Both callers already had bytes available, but were scaling to sectors. Move the scaling to internal code. In the case of bdrv_aligned_pwritev(), we are now passing the exact offset rather than a rounded sector-aligned value, but that's okay as long as dirty bitmap widens start/bytes to

[Qemu-block] [PATCH v6 11/18] dirty-bitmap: Change bdrv_get_dirty_locked() to take bytes

2017-08-30 Thread Eric Blake
Half the callers were already scaling bytes to sectors; the other half can eventually be simplified to use byte iteration. Both callers were already using the result as a bool, so make that explicit. Making the change also makes it easier for a future dirty-bitmap patch to offload scaling over

[Qemu-block] [PATCH v6 10/18] dirty-bitmap: Change bdrv_get_dirty_count() to report bytes

2017-08-30 Thread Eric Blake
Thanks to recent cleanups, all callers were scaling a return value of sectors into bytes; do the scaling internally instead. Signed-off-by: Eric Blake Reviewed-by: John Snow Reviewed-by: Juan Quintela --- v4: no change v3: no change,

[Qemu-block] [PATCH v6 08/18] dirty-bitmap: Set iterator start by offset, not sector

2017-08-30 Thread Eric Blake
All callers to bdrv_dirty_iter_new() passed 0 for their initial starting point, drop that parameter. Most callers to bdrv_set_dirty_iter() were scaling a byte offset to a sector number; the exception qcow2-bitmap will be converted later to use byte rather than sector iteration. Move the scaling

[Qemu-block] [PATCH v6 16/18] qcow2: Switch store_bitmap_data() to byte-based iteration

2017-08-30 Thread Eric Blake
Now that we have adjusted the majority of the calls this function makes to be byte-based, it is easier to read the code if it makes passes over the image using bytes rather than sectors. Signed-off-by: Eric Blake Reviewed-by: John Snow Reviewed-by: Vladimir

[Qemu-block] [PATCH v6 04/18] dirty-bitmap: Drop unused functions

2017-08-30 Thread Eric Blake
We had several functions that no one is currently using, and which use sector-based interfaces. I'm trying to convert towards byte-based interfaces, so it's easier to just drop the unused functions: bdrv_dirty_bitmap_get_meta bdrv_dirty_bitmap_get_meta_locked bdrv_dirty_bitmap_reset_meta

[Qemu-block] [PATCH v6 09/18] dirty-bitmap: Change bdrv_dirty_iter_next() to report byte offset

2017-08-30 Thread Eric Blake
Thanks to recent cleanups, most callers were scaling a return value of sectors into bytes (the exception, in qcow2-bitmap, will be converted to byte-based iteration later). Update the interface to do the scaling internally instead. Signed-off-by: Eric Blake Reviewed-By: John

[Qemu-block] [PATCH v6 14/18] qcow2: Switch qcow2_measure() to byte-based iteration

2017-08-30 Thread Eric Blake
This is new code, but it is easier to read if it makes passes over the image using bytes rather than sectors (and will get easier in the future when bdrv_get_block_status is converted to byte-based). Signed-off-by: Eric Blake Reviewed-by: John Snow --- v6:

[Qemu-block] [PATCH v6 06/18] dirty-bitmap: Change bdrv_dirty_bitmap_*serialize*() to take bytes

2017-08-30 Thread Eric Blake
Right now, the dirty-bitmap code exposes the fact that we use a scale of sector granularity in the underlying hbitmap to anything that wants to serialize a dirty bitmap. It's nicer to uniformly expose bytes as our dirty-bitmap interface, matching the previous change to bitmap size. The only

[Qemu-block] [PATCH v6 02/18] hbitmap: Rename serialization_granularity to serialization_align

2017-08-30 Thread Eric Blake
The only client of hbitmap_serialization_granularity() is dirty-bitmap's bdrv_dirty_bitmap_serialization_align(). Keeping the two names consistent is worthwhile, and the shorter name is more representative of what the function returns (the required alignment to be used for start/count of other

[Qemu-block] [PATCH v6 07/18] qcow2: Switch sectors_covered_by_bitmap_cluster() to byte-based

2017-08-30 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Change the qcow2 bitmap helper function sectors_covered_by_bitmap_cluster(), renaming it to bytes_covered_by_bitmap_cluster() in the process. Signed-off-by: Eric Blake

[Qemu-block] [PATCH v6 01/18] block: Make bdrv_img_create() size selection easier to read

2017-08-30 Thread Eric Blake
All callers of bdrv_img_create() pass in a size, or -1 to read the size from the backing file. We then set that size as the QemuOpt default, which means we will reuse that default rather than the final parameter to qemu_opt_get_size() several lines later. But it is rather confusing to read

[Qemu-block] [PATCH v6 00/18] make dirty-bitmap byte-based

2017-08-30 Thread Eric Blake
There are patches floating around to add NBD_CMD_BLOCK_STATUS, but NBD wants to report status on byte granularity (even if the reporting will probably be naturally aligned to sectors or even much higher levels). I've therefore started the task of converting our block status code to report at a

[Qemu-block] [PATCH v6 05/18] dirty-bitmap: Change bdrv_dirty_bitmap_size() to report bytes

2017-08-30 Thread Eric Blake
We are still using an internal hbitmap that tracks a size in sectors, with the granularity scaled down accordingly, because it lets us use a shortcut for our iterators which are currently sector-based. But there's no reason we can't track the dirty bitmap size in bytes, since it is (mostly) an

[Qemu-block] [PATCH v6 03/18] qcow2: Ensure bitmap serialization is aligned

2017-08-30 Thread Eric Blake
When subdividing a bitmap serialization, the code in hbitmap.c enforces that start/count parameters are aligned (except that count can end early at end-of-bitmap). We exposed this required alignment through bdrv_dirty_bitmap_serialization_align(), but forgot to actually check that we comply with

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/7] block/ssh: don't call libssh2_init() in block_init()

2017-08-30 Thread Eric Blake
On 08/30/2017 03:11 PM, Jeff Cody wrote: > On Wed, Aug 30, 2017 at 02:40:16PM -0500, Eric Blake wrote: >> On 08/30/2017 11:56 AM, Jeff Cody wrote: >>> We don't need libssh2 failure to be fatal (we could just opt to not >>> register the driver on failure). But, it is probably a good idea to >>>

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/7] block/ssh: don't call libssh2_init() in block_init()

2017-08-30 Thread Jeff Cody
On Wed, Aug 30, 2017 at 02:40:16PM -0500, Eric Blake wrote: > On 08/30/2017 11:56 AM, Jeff Cody wrote: > > We don't need libssh2 failure to be fatal (we could just opt to not > > register the driver on failure). But, it is probably a good idea to > > avoid external library calls during the

Re: [Qemu-block] [Qemu-devel] [PATCH v2 7/7] block/curl: code cleanup to comply with coding style

2017-08-30 Thread Eric Blake
On 08/30/2017 11:57 AM, Jeff Cody wrote: > This addresses non-functional changes to help curl.c better comply > with the coding styles (comments, indentation, brackets, etc.). > > One minor code change is the combination of two if statements into > a single if statement. > > Signed-off-by: Jeff

Re: [Qemu-block] [Qemu-devel] [PATCH v2 6/7] block/curl: fix minor memory leaks

2017-08-30 Thread Eric Blake
On 08/30/2017 11:57 AM, Jeff Cody wrote: > Signed-off-by: Jeff Cody > --- > block/curl.c | 6 ++ > 1 file changed, 6 insertions(+) > > +++ b/block/curl.c > @@ -857,6 +857,9 @@ out_noclean: > qemu_mutex_destroy(>mutex); > g_free(s->cookie); > g_free(s->url);

Re: [Qemu-block] [Qemu-devel] [PATCH v2 5/7] block/curl: check error return of curl_global_init()

2017-08-30 Thread Eric Blake
On 08/30/2017 11:57 AM, Jeff Cody wrote: > If curl_global_init() fails, per the documentation no other curl > functions may be called, so make sure to check the return value. > > Also, some minor changes to the initialization latch variable 'inited': > > - Make it static in the file, for clarity

Re: [Qemu-block] [Qemu-devel] [PATCH v2 4/7] block/sheepdog: code beautification

2017-08-30 Thread Eric Blake
On 08/30/2017 11:57 AM, Jeff Cody wrote: > No functional changes, just whitespace manipulation. > > Signed-off-by: Jeff Cody > --- > block/sheepdog.c | 162 > +++ > 1 file changed, 81 insertions(+), 81 deletions(-) > >

Re: [Qemu-block] [Qemu-devel] [PATCH v2 3/7] block/sheepdog: remove spurious NULL check

2017-08-30 Thread Eric Blake
On 08/30/2017 11:57 AM, Jeff Cody wrote: > 'tag' is already checked in the lines immediately preceding this check, > and set to non-NULL if NULL. No need to check again, it hasn't changed. > > Signed-off-by: Jeff Cody > --- > block/sheepdog.c | 2 +- > 1 file changed, 1

Re: [Qemu-block] [Qemu-devel] [PATCH v2 2/7] block/ssh: make compliant with coding guidelines

2017-08-30 Thread Eric Blake
On 08/30/2017 11:56 AM, Jeff Cody wrote: > Signed-off-by: Jeff Cody > --- > block/ssh.c | 32 ++-- > 1 file changed, 18 insertions(+), 14 deletions(-) Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat,

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/7] block/ssh: don't call libssh2_init() in block_init()

2017-08-30 Thread Eric Blake
On 08/30/2017 11:56 AM, Jeff Cody wrote: > We don't need libssh2 failure to be fatal (we could just opt to not > register the driver on failure). But, it is probably a good idea to > avoid external library calls during the block_init(), and call the > libssh2 global init function on the first

Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/3] Live block optional disable

2017-08-30 Thread Eric Blake
On 08/30/2017 12:01 PM, Jeff Cody wrote: > This series adds a configurable option to disable live block operations. > > The default is that live block operations are 'enabled'. > > Jeffrey Cody (3): > configure: Add option in configure to disable live block ops > block-jobs: Optionally

Re: [Qemu-block] [Qemu-devel] [PATCH v2 2/3] block-jobs: Optionally unregister live block operations

2017-08-30 Thread Eric Blake
On 08/30/2017 12:24 PM, Eduardo Habkost wrote: > On Wed, Aug 30, 2017 at 01:01:41PM -0400, Jeff Cody wrote: >> From: Jeffrey Cody >> >> If configured without live block operations enabled, unregister the >> live block operation commands. >> >> Signed-off-by: Jeff Cody

Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/3] Live block optional disable

2017-08-30 Thread Eric Blake
On 08/30/2017 12:01 PM, Jeff Cody wrote: > This series adds a configurable option to disable live block operations. > > The default is that live block operations are 'enabled'. > > Jeffrey Cody (3): > configure: Add option in configure to disable live block ops > block-jobs: Optionally

Re: [Qemu-block] [PATCH v3 5/5] qemu-iotests: add option to save temp files on error

2017-08-30 Thread Eric Blake
On 08/30/2017 11:52 AM, Jeff Cody wrote: > Now that ./check takes care of cleaning up after each tests, it > can also selectively not clean up. Add option to leave all output from > tests intact if that test encountered an error. > > Note: this currently only works for bash tests, as the python

Re: [Qemu-block] [PATCH v3 4/5] qemu-iotests: make python tests attempt to leave intermediate files

2017-08-30 Thread Eric Blake
On 08/30/2017 11:52 AM, Jeff Cody wrote: > Now that 'check' will clean up after tests, try and make python > tests leave intermediate files so that they might be inspectable > on failure. > > This isn't perfect; the python unittest framework runs multiple > tests, even if previous tests failed.

Re: [Qemu-block] [PATCH v3 3/5] qemu-iotests: add 'blind_remove' for python tests

2017-08-30 Thread Eric Blake
On 08/30/2017 11:52 AM, Jeff Cody wrote: > Add a function to attempt to 'blindly' remove a file, without > throwing an error if the file doesn't exist. > > Signed-off-by: Jeff Cody > --- > tests/qemu-iotests/iotests.py | 7 +++ > 1 file changed, 7 insertions(+) > > diff

[Qemu-block] [PULL 11/11] block/nbd-client: refactor request send/receive

2017-08-30 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Add nbd_co_request, to remove code duplications in nbd_client_co_{pwrite,pread,...} functions. Also this is needed for further refactoring. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id:

[Qemu-block] [PULL 10/11] block/nbd-client: rename nbd_recv_coroutines_enter_all

2017-08-30 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Rename nbd_recv_coroutines_enter_all to nbd_recv_coroutines_wake_all, as it most probably just adds all recv coroutines into co_queue_wakeup, rather than directly enter them. Signed-off-by: Vladimir Sementsov-Ogievskiy

[Qemu-block] [PULL 06/11] nbd/client: refactor nbd_read_eof

2017-08-30 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Refactor nbd_read_eof to return 1 on success, 0 on eof, when no data was read and <0 for other cases, because returned size of read data is not actually used. Signed-off-by: Vladimir Sementsov-Ogievskiy

[Qemu-block] [PULL 03/11] qemu-iotests: improve nbd-fault-injector.py startup protocol

2017-08-30 Thread Eric Blake
From: Stefan Hajnoczi Currently 083 waits for the nbd-fault-injector.py server to start up by looping until netstat shows the TCP listen socket. The startup protocol can be simplified by passing a 0 port number to nbd-fault-injector.py. The kernel will allocate a port in

[Qemu-block] [PULL 07/11] nbd/client: refactor nbd_receive_reply

2017-08-30 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Refactor nbd_receive_reply to return 1 on success, 0 on eof, when no data was read and <0 for other cases, because returned size of read data is not actually used. Signed-off-by: Vladimir Sementsov-Ogievskiy

[Qemu-block] [PULL 02/11] nbd-client: avoid read_reply_co entry if send failed

2017-08-30 Thread Eric Blake
From: Stefan Hajnoczi The following segfault is encountered if the NBD server closes the UNIX domain socket immediately after negotiation: Program terminated with signal SIGSEGV, Segmentation fault. #0 aio_co_schedule (ctx=0x0, co=0xd3c0ff2ef0) at util/async.c:441

[Qemu-block] [PULL 05/11] nbd/client: fix nbd_opt_go

2017-08-30 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Do not send NBD_OPT_ABORT to the broken server. After sending NBD_REP_ACK on NBD_OPT_GO server is most probably in transmission phase, when option sending is finished. Signed-off-by: Vladimir Sementsov-Ogievskiy

[Qemu-block] [PULL 04/11] qemu-iotests: test NBD over UNIX domain sockets in 083

2017-08-30 Thread Eric Blake
From: Stefan Hajnoczi 083 only tests TCP. Some failures might be specific to UNIX domain sockets. A few adjustments are necessary: 1. Generating a port number and waiting for server startup is TCP-specific. Use the new nbd-fault-injector.py startup protocol to

[Qemu-block] [PULL 01/11] qemu-iotests: Extend non-shared storage migration test (194)

2017-08-30 Thread Eric Blake
From: Kashyap Chamarthy This is the follow-up patch that was discussed[*] as part of feedback to qemu-iotest 194. Changes in this patch: - Supply 'job-id' parameter to `drive-mirror` invocation. - Once migration completes, issue QMP `block-job-cancel` command on

Re: [Qemu-block] [Qemu-devel] [PATCH] qcow2: allocate cluster_cache/cluster_data on demand

2017-08-30 Thread Stefan Hajnoczi
On Tue, Aug 22, 2017 at 02:56:00PM +1000, Alexey Kardashevskiy wrote: > On 19/08/17 12:46, Alexey Kardashevskiy wrote: > > On 19/08/17 01:18, Eric Blake wrote: > >> On 08/18/2017 08:31 AM, Stefan Hajnoczi wrote: > >>> Most qcow2 files are uncompressed so it is wasteful to allocate (32 + 1) > >>> *

[Qemu-block] [PATCH v2 3/3] hmp: Optionally disable live block operations in HMP monitor

2017-08-30 Thread Jeff Cody
From: Jeffrey Cody If live block operations are disabled, disable the corresponding HMP commands. Signed-off-by: Jeff Cody --- hmp-commands-info.hx | 4 hmp-commands.hx | 12 hmp.c| 12 3 files changed,

Re: [Qemu-block] [Qemu-devel] [PATCH v2 3/7] block/sheepdog: remove spurious NULL check

2017-08-30 Thread Philippe Mathieu-Daudé
On Wed, Aug 30, 2017 at 1:57 PM, Jeff Cody wrote: > 'tag' is already checked in the lines immediately preceding this check, > and set to non-NULL if NULL. No need to check again, it hasn't changed. > > Signed-off-by: Jeff Cody > --- > block/sheepdog.c | 2 +-

[Qemu-block] [PATCH v2 4/7] block/sheepdog: code beautification

2017-08-30 Thread Jeff Cody
No functional changes, just whitespace manipulation. Signed-off-by: Jeff Cody --- block/sheepdog.c | 162 +++ 1 file changed, 81 insertions(+), 81 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index

[Qemu-block] [PATCH v2 6/7] block/curl: fix minor memory leaks

2017-08-30 Thread Jeff Cody
Signed-off-by: Jeff Cody --- block/curl.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/block/curl.c b/block/curl.c index 00a9879..35cf417 100644 --- a/block/curl.c +++ b/block/curl.c @@ -857,6 +857,9 @@ out_noclean: qemu_mutex_destroy(>mutex);

Re: [Qemu-block] [PATCH 10/10] scsi: add persistent reservation manager using qemu-pr-helper

2017-08-30 Thread Stefan Hajnoczi
On Tue, Aug 22, 2017 at 03:18:32PM +0200, Paolo Bonzini wrote: > +/* Called with lock held. */ > +static int pr_manager_helper_read(PRManagerHelper *pr_mgr, > + void *buf, int sz, Error **errp) > +{ > +ssize_t r = qio_channel_read_all(pr_mgr->ioc, buf, sz,

[Qemu-block] [PATCH v2 1/3] configure: Add option in configure to disable live block ops

2017-08-30 Thread Jeff Cody
From: Jeffrey Cody This adds in the option to disable the live block operations. The resultant config option is not checked until subsequent patches. Signed-off-by: Jeff Cody --- configure | 11 +++ 1 file changed, 11 insertions(+) diff --git

[Qemu-block] [PATCH v2 2/7] block/ssh: make compliant with coding guidelines

2017-08-30 Thread Jeff Cody
Signed-off-by: Jeff Cody --- block/ssh.c | 32 ++-- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/block/ssh.c b/block/ssh.c index cbb0e34..97f7673 100644 --- a/block/ssh.c +++ b/block/ssh.c @@ -241,7 +241,7 @@ static int

[Qemu-block] [PATCH v2 3/7] block/sheepdog: remove spurious NULL check

2017-08-30 Thread Jeff Cody
'tag' is already checked in the lines immediately preceding this check, and set to non-NULL if NULL. No need to check again, it hasn't changed. Signed-off-by: Jeff Cody --- block/sheepdog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/sheepdog.c

[Qemu-block] [PATCH v2 0/7] Code cleanup and minor fixes

2017-08-30 Thread Jeff Cody
Minor bug fixes and code cleanup. Changes from v1 -> v2: Rebased to v2.10.0 Jeff Cody (7): block/ssh: don't call libssh2_init() in block_init() block/ssh: make compliant with coding guidelines block/sheepdog: remove spurious NULL check block/sheepdog: code beautification block/curl:

Re: [Qemu-block] [PATCH v2] qcow2: allocate cluster_cache/cluster_data on demand

2017-08-30 Thread Stefan Hajnoczi
On Mon, Aug 21, 2017 at 02:55:30PM +0100, Stefan Hajnoczi wrote: > Most qcow2 files are uncompressed so it is wasteful to allocate (32 + 1) > * cluster_size + 512 bytes upfront. Allocate s->cluster_cache and > s->cluster_data when the first read operation is performance on a > compressed cluster.

[Qemu-block] [PATCH v2 0/3] Live block optional disable

2017-08-30 Thread Jeff Cody
This series adds a configurable option to disable live block operations. The default is that live block operations are 'enabled'. Jeffrey Cody (3): configure: Add option in configure to disable live block ops block-jobs: Optionally unregister live block operations hmp: Optionally disable

[Qemu-block] [PATCH v2 2/3] block-jobs: Optionally unregister live block operations

2017-08-30 Thread Jeff Cody
From: Jeffrey Cody If configured without live block operations enabled, unregister the live block operation commands. Signed-off-by: Jeff Cody --- monitor.c | 16 1 file changed, 16 insertions(+) diff --git a/monitor.c b/monitor.c index

[Qemu-block] [PATCH v2 5/7] block/curl: check error return of curl_global_init()

2017-08-30 Thread Jeff Cody
If curl_global_init() fails, per the documentation no other curl functions may be called, so make sure to check the return value. Also, some minor changes to the initialization latch variable 'inited': - Make it static in the file, for clarity - Change the name for clarity - Make it a bool

[Qemu-block] [PATCH v2 1/7] block/ssh: don't call libssh2_init() in block_init()

2017-08-30 Thread Jeff Cody
We don't need libssh2 failure to be fatal (we could just opt to not register the driver on failure). But, it is probably a good idea to avoid external library calls during the block_init(), and call the libssh2 global init function on the first usage, returning any errors. Signed-off-by: Jeff

[Qemu-block] [PATCH v3 5/5] qemu-iotests: add option to save temp files on error

2017-08-30 Thread Jeff Cody
Now that ./check takes care of cleaning up after each tests, it can also selectively not clean up. Add option to leave all output from tests intact if that test encountered an error. Note: this currently only works for bash tests, as the python tests still clean up after themselves manually.

[Qemu-block] [PATCH v3 4/5] qemu-iotests: make python tests attempt to leave intermediate files

2017-08-30 Thread Jeff Cody
Now that 'check' will clean up after tests, try and make python tests leave intermediate files so that they might be inspectable on failure. This isn't perfect; the python unittest framework runs multiple tests, even if previous tests failed. So we need to make sure that each test still begins

[Qemu-block] [PATCH v3 2/5] qemu-iotests: remove file cleanup from bash tests

2017-08-30 Thread Jeff Cody
All files for a given test are now self-contained in a subdirectory, and therefore the "./check" script can do all file-related cleanup without any help. This removes file cleanups from the bash tests. The only cleanup left is whatever is needed to kill any spawned processes; e.g. _cleanup_qemu.

[Qemu-block] [PATCH v3 0/5] qemu-iotests: place output in unique dir

2017-08-30 Thread Jeff Cody
Differences v2 -> v3: git-backport-diff -r qemu/master..devel-iotests -u github/devel-next Key: [] : patches are identical [] : number of functional differences between upstream/downstream patch [down] : patch is downstream-only The flags [FC] indicate (F)unctional and (C)ontextual

[Qemu-block] [PATCH v3 1/5] qemu-iotests: set TEST_DIR to a unique dir for each test

2017-08-30 Thread Jeff Cody
Right now, all qemu-iotests output data into the same scratch directory, and so each test needs to be responsible for cleaning up its own files. Have each test use 'scratch/$seq' as its temp directory, so the check script can do simple cleanup of removing the whole temporary directory.

[Qemu-block] [PATCH v3 3/5] qemu-iotests: add 'blind_remove' for python tests

2017-08-30 Thread Jeff Cody
Add a function to attempt to 'blindly' remove a file, without throwing an error if the file doesn't exist. Signed-off-by: Jeff Cody --- tests/qemu-iotests/iotests.py | 7 +++ 1 file changed, 7 insertions(+) diff --git a/tests/qemu-iotests/iotests.py

Re: [Qemu-block] [Qemu-devel] [PATCH 09/10] scsi: add multipath support to qemu-pr-helper

2017-08-30 Thread Stefan Hajnoczi
On Tue, Aug 22, 2017 at 03:18:31PM +0200, Paolo Bonzini wrote: > +static int multipath_pr_in(int fd, const uint8_t *cdb, uint8_t *sense, > + uint8_t *data, int sz) > +{ > +int rq_servact = cdb[1]; > +struct prin_resp resp; > +size_t written; > +int r; > +

Re: [Qemu-block] [PATCH 08/10] scsi: build qemu-pr-helper

2017-08-30 Thread Stefan Hajnoczi
On Tue, Aug 22, 2017 at 03:18:30PM +0200, Paolo Bonzini wrote: > +#ifdef CONFIG_MPATH > +dm_init(); > +multipath_pr_init(); > +#endif This should be in the next patch. Stefan

Re: [Qemu-block] [Qemu-devel] [PATCH 09/10] scsi: add multipath support to qemu-pr-helper

2017-08-30 Thread Stefan Hajnoczi
On Tue, Aug 22, 2017 at 03:18:31PM +0200, Paolo Bonzini wrote: > @@ -444,6 +740,11 @@ static int drop_privileges(void) > CAP_SYS_RAWIO) < 0) { > return -1; > } > +/* For /dev/mapper/control ioctls */ > +if (capng_update(CAPNG_ADD, CAPNG_EFFECTIVE |

Re: [Qemu-block] [PATCH 08/10] scsi: build qemu-pr-helper

2017-08-30 Thread Stefan Hajnoczi
On Tue, Aug 22, 2017 at 03:18:30PM +0200, Paolo Bonzini wrote: > diff --git a/docs/interop/pr-helper.rst b/docs/interop/pr-helper.rst > new file mode 100644 > index 00..765174c31f > --- /dev/null > +++ b/docs/interop/pr-helper.rst > @@ -0,0 +1,78 @@ > +.. > + >

Re: [Qemu-block] [PATCH 07/10] io: add qio_channel_read/write_all

2017-08-30 Thread Stefan Hajnoczi
On Tue, Aug 22, 2017 at 03:18:29PM +0200, Paolo Bonzini wrote: > @@ -315,6 +315,23 @@ ssize_t qio_channel_read(QIOChannel *ioc, > Error **errp); > > /** > + * qio_channel_read_all: > + * @ioc: the channel object > + * @buf: the memory region to read data into > + *

Re: [Qemu-block] [PATCH 06/10] scsi, file-posix: add support for persistent reservation management

2017-08-30 Thread Stefan Hajnoczi
On Tue, Aug 22, 2017 at 03:18:28PM +0200, Paolo Bonzini wrote: > +#ifdef CONFIG_LINUX > +PRManager *pr_manager_lookup(const char *id, Error **errp); > +#else > +static inline PRManager *pr_manager_lookup(const char *id, > + Error **errp)

Re: [Qemu-block] [PATCH] block: Cleanup BMDS in bdrv_close_all

2017-08-30 Thread Juan Quintela
Fam Zheng wrote: > On Wed, 08/30 13:49, Juan Quintela wrote: >> Fam Zheng wrote: >> > This fixes the assertion due to op blockers added by BMDS: >> > >> > block.c:3248: bdrv_delete: Assertion `bdrv_op_blocker_is_empty(bs)' failed. >> > >> > Reproducer: simply

Re: [Qemu-block] [Qemu-devel] Persistent bitmaps for non-qcow2 formats

2017-08-30 Thread Daniel P. Berrange
On Wed, Aug 30, 2017 at 02:36:11PM +0100, Stefan Hajnoczi wrote: > On Tue, Aug 22, 2017 at 03:07:04PM -0400, John Snow wrote: > > (3) Add either a new flag that turns qcow2's backing file into a full > > R/W backing file, or add a new extension to qcow2 entirely (bypassing > > the traditional

Re: [Qemu-block] [Qemu-devel] [PATCH 05/10] scsi: move block/scsi.h to include/scsi/constants.h

2017-08-30 Thread Stefan Hajnoczi
On Tue, Aug 22, 2017 at 03:18:27PM +0200, Paolo Bonzini wrote: > Complete the transition by renaming this header, which was > shared by block/iscsi.c and the SCSI emulation code. > > Signed-off-by: Paolo Bonzini > --- > block/iscsi.c | 2 +- >

Re: [Qemu-block] [Qemu-devel] [PATCH 04/10] scsi: introduce sg_io_sense_from_errno

2017-08-30 Thread Stefan Hajnoczi
On Tue, Aug 22, 2017 at 03:18:26PM +0200, Paolo Bonzini wrote: > Move more knowledge of SG_IO out of hw/scsi/scsi-generic.c, for > reusability. > > Signed-off-by: Paolo Bonzini > --- > hw/scsi/scsi-generic.c | 40 +++- >

Re: [Qemu-block] [Qemu-devel] [PATCH 03/10] scsi: introduce scsi_build_sense

2017-08-30 Thread Stefan Hajnoczi
On Tue, Aug 22, 2017 at 03:18:25PM +0200, Paolo Bonzini wrote: > Move more knowledge of sense data format out of hw/scsi/scsi-bus.c > for reusability. > > Signed-off-by: Paolo Bonzini > --- > hw/scsi/scsi-bus.c | 8 +--- > include/scsi/utils.h | 2 ++ > scsi/utils.c

Re: [Qemu-block] Persistent bitmaps for non-qcow2 formats

2017-08-30 Thread Stefan Hajnoczi
On Tue, Aug 22, 2017 at 03:07:04PM -0400, John Snow wrote: > (3) Add either a new flag that turns qcow2's backing file into a full > R/W backing file, or add a new extension to qcow2 entirely (bypassing > the traditional backing file mechanism to avoid confusion for older > tooling) that adds a

Re: [Qemu-block] [Qemu-devel] [PATCH] block: Cleanup BMDS in bdrv_close_all

2017-08-30 Thread Fam Zheng
On Wed, 08/30 13:49, Juan Quintela wrote: > Fam Zheng wrote: > > This fixes the assertion due to op blockers added by BMDS: > > > > block.c:3248: bdrv_delete: Assertion `bdrv_op_blocker_is_empty(bs)' failed. > > > > Reproducer: simply start block migration and quit QEMU before it

Re: [Qemu-block] [PATCH v2 0/7] Refactor DMG driver to have chunk size independence

2017-08-30 Thread Ashijeet Acharya
On Tue, Aug 29, 2017 at 8:55 PM, Stefan Hajnoczi wrote: > On Sun, Aug 20, 2017 at 1:47 PM, Ashijeet Acharya > wrote: > > On Fri, May 5, 2017 at 7:29 PM, Stefan Hajnoczi > wrote: > >> > >> On Thu, Apr 27, 2017 at 01:36:30PM

Re: [Qemu-block] [Qemu-devel] [PATCH 06/10] scsi, file-posix: add support for persistent reservation management

2017-08-30 Thread Daniel P. Berrange
On Tue, Aug 22, 2017 at 03:18:28PM +0200, Paolo Bonzini wrote: > It is a common requirement for virtual machine to send persistent > reservations, but this currently requires either running QEMU with > CAP_SYS_RAWIO, or using out-of-tree patches that let an unprivileged > QEMU bypass Linux's

Re: [Qemu-block] [Qemu-devel] Persistent bitmaps for non-qcow2 formats

2017-08-30 Thread Yaniv Lavi (Dary)
YANIV LAVI (YANIV DARY) SENIOR TECHNICAL PRODUCT MANAGER Red Hat Israel Ltd. 34 Jerusalem Road, Building A, 1st floor Ra'anana, Israel 4350109 yl...@redhat.comT: +972-9-7692306/8272306 F: +972-9-7692223IM: ylavi TRIED. TESTED.

Re: [Qemu-block] [PATCH 07/10] io: add qio_channel_read/write_all

2017-08-30 Thread Daniel P. Berrange
On Tue, Aug 22, 2017 at 03:18:29PM +0200, Paolo Bonzini wrote: > It is pretty common to read a fixed-size buffer from a socket. Add a > function that does this, either with multiple reads (on blocking sockets) > or by yielding if called from a coroutine. > > Cc: Daniel P. Berrange

Re: [Qemu-block] [PATCH] block: Cleanup BMDS in bdrv_close_all

2017-08-30 Thread Juan Quintela
Fam Zheng wrote: > This fixes the assertion due to op blockers added by BMDS: > > block.c:3248: bdrv_delete: Assertion `bdrv_op_blocker_is_empty(bs)' failed. > > Reproducer: simply start block migration and quit QEMU before it ends. > > Cc: qemu-sta...@nongnu.org > Signed-off-by:

Re: [Qemu-block] [Qemu-devel] Persistent bitmaps for non-qcow2 formats

2017-08-30 Thread Max Reitz
On 2017-08-29 23:02, John Snow wrote: > > > On 08/29/2017 10:30 AM, Eric Blake wrote: >> On 08/28/2017 08:18 PM, John Snow wrote: > We'd have to develop a new syntax for specifying these resources that > can be stored in a qcow2 file, It's called the json-pseudo-protocol and

Re: [Qemu-block] [Qemu-devel] Persistent bitmaps for non-qcow2 formats

2017-08-30 Thread Max Reitz
On 2017-08-29 03:18, John Snow wrote: > > > On 08/25/2017 09:44 AM, Max Reitz wrote: >> On 2017-08-25 02:55, John Snow wrote: [...] >>> In (1), we avoid saving or specifying the relationship between these two >>> data stores in any way. This is certainly easy to do, and will save us >>> some

  1   2   >