Re: [Qemu-block] [Qemu-devel] [PULL 48/48] iotests: Test qemu-img convert -S 0 behavior

2016-04-07 Thread Fam Zheng
On Thu, 04/07 16:40, Paolo Bonzini wrote: > > > On 29/03/2016 17:08, Kevin Wolf wrote: > > From: Max Reitz > > > > Passing -S 0 to qemu-img convert should result in all source data being > > copied to the output, even if that source data is known to be 0. The > > output

[Qemu-block] [PATCH for-2.7 1/1] block/gluster: add support for selecting debug logging level

2016-04-07 Thread Jeff Cody
This adds commandline support for the logging level of the gluster protocol driver, output to stdout. The option is 'debug', e.g.: -drive filename=gluster://192.168.15.180/gv2/test.qcow2,debug=9 Debug levels are 0-9, with 9 being the most verbose, and 0 representing no debugging output. The

Re: [Qemu-block] [PATCH 1/7] qemu-iotests: check: don't place files with predictable names in /tmp

2016-04-07 Thread Sascha Silbe
Dear Max, Max Reitz writes: > You decide whether you want to drop the tmp=/tmp/$$ lines in the tests > in a dedicated (follow-up) patch or include it here. Let's land this one first; I'll address the other occurrences in a separate patch. I've put it on my todo list. Thanks

Re: [Qemu-block] [PATCH 6/7] qemu-iotests: 141: reduce likelihood of race condition on systems with fast IO

2016-04-07 Thread Sascha Silbe
Dear Max, Max Reitz writes: > On 05.04.2016 11:21, Sascha Silbe wrote: >> On systems with fast IO, qemu-io may write more than 1 MiB before >> receiving the block-job-cancel command, causing the test case to fail. >> >> 141 is inherently racy, but we can at least reduce the

Re: [Qemu-block] [PATCH 3/7] qemu-iotests: iotests.VM: remove qtest socket on error

2016-04-07 Thread Sascha Silbe
Dear Max, Max Reitz writes: > On 05.04.2016 11:21, Sascha Silbe wrote: [...] [_remove_if_exists()] > Not sure about the leading underscore (it appears to be the only such > function in iotests.py besides __init__()), but I guess it's a test so > it doesn't really matter

Re: [Qemu-block] [PATCH] xen: piix reuse pci generic class init function

2016-04-07 Thread Stefano Stabellini
On Thu, 7 Apr 2016, John Snow wrote: > > On Wed, Apr 06, 2016 at 04:56:12PM -0700, Stefano Stabellini wrote: > >> On Sun, 3 Apr 2016, Michael S. Tsirkin wrote: > >>> piix3_ide_xen_class_init is identical to piix3_ide_class_init > >>> except it's buggy as it does not set exit and does not disable >

[Qemu-block] [PATCH v4 5/8] block: introduce bdrv_no_throttling_begin/end

2016-04-07 Thread Paolo Bonzini
Extract the handling of throttling from bdrv_flush_io_queue. These new functions will soon become BdrvChildRole callbacks, as they can be generalized to "beginning of drain" and "end of drain". Reviewed-by: Alberto Garcia Signed-off-by: Paolo Bonzini ---

[Qemu-block] [PATCH v4 6/8] block: plug whole tree at once, introduce bdrv_io_unplugged_begin/end

2016-04-07 Thread Paolo Bonzini
Extract the handling of io_plug "depth" from linux-aio.c and let the main bdrv_drain loop do nothing but wait on I/O. Like the two newly introduced functions, bdrv_io_plug and bdrv_io_unplug now operate on all children. The visit order is now symmetrical between plug and unplug, making it

[Qemu-block] [PATCH v4 7/8] linux-aio: make it more type safe

2016-04-07 Thread Paolo Bonzini
Replace void* with an opaque LinuxAioState type. Signed-off-by: Paolo Bonzini --- block/linux-aio.c | 46 +- block/raw-aio.h | 15 --- block/raw-posix.c | 4 ++-- 3 files changed, 27 insertions(+), 38 deletions(-)

[Qemu-block] [PATCH v4 1/8] block: Don't disable I/O throttling on sync requests

2016-04-07 Thread Paolo Bonzini
From: Kevin Wolf We had to disable I/O throttling with synchronous requests because we didn't use to run timers in nested event loops when the code was introduced. This isn't true any more, and throttling works just fine even when using the synchronous API. The removed code is

[Qemu-block] [PATCH v4 4/8] block: extract bdrv_drain_poll/bdrv_co_yield_to_drain from bdrv_drain/bdrv_co_drain

2016-04-07 Thread Paolo Bonzini
Do not call bdrv_drain_recurse twice in bdrv_co_drain. A small tweak to the logic in Fam's patch, which is harmless since no one implements bdrv_drain anyway. But better get it right. Signed-off-by: Paolo Bonzini --- v4: new block/io.c | 35

[Qemu-block] [PATCH v4 3/8] block: move restarting of throttled reqs to block/throttle-groups.c

2016-04-07 Thread Paolo Bonzini
We want to remove throttled_reqs from block/io.c. This is the easy part---hide the handling of throttled_reqs during disable/enable of throttling within throttle-groups.c. Signed-off-by: Paolo Bonzini --- v1->v2: only restart first request after

[Qemu-block] [PATCH v4 0/8] bdrv_flush_io_queue removal, shared LinuxAioState

2016-04-07 Thread Paolo Bonzini
Patch 1 comes from Kevin's series to do BlockBackend throttling. Patches 2-6 are from my bdrv_drain patches. They apply on top of Fam's patch (which will be in 2.6) that introduces bdrv_co_drain. Patch 4 is new in this version, compared to v3. Patches 7-8 are new but based on Ming Lei's old

[Qemu-block] [PATCH v4 8/8] linux-aio: share one LinuxAioState within an AioContext

2016-04-07 Thread Paolo Bonzini
This has better performance because it executes fewer system calls and does not use a bottom half per disk. Originally proposed by Ming Lei. Signed-off-by: Paolo Bonzini --- async.c| 23 +++ block/linux-aio.c | 3 +

[Qemu-block] [PATCH v4 2/8] block: make bdrv_start_throttled_reqs return void

2016-04-07 Thread Paolo Bonzini
The return value is unused and I am not sure why it would be useful. Reviewed-by: Fam Zheng Signed-off-by: Paolo Bonzini --- block/io.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/block/io.c b/block/io.c index

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.6] crypto: Avoid memory leak on failure

2016-04-07 Thread Eric Blake
On 04/07/2016 09:14 AM, Markus Armbruster wrote: > Max Reitz writes: > >> On 01.04.2016 17:57, Eric Blake wrote: >>> Commit 7836857 introduced a memory leak due to invalid use of >>> Error vs. visit_type_end(). If visiting the intermediate >>> members fails, we clear the

Re: [Qemu-block] [PATCH for-2.6 2/2] block/gluster: prevent data loss after i/o error

2016-04-07 Thread Jeff Cody
On Wed, Apr 06, 2016 at 01:02:16PM +0200, Kevin Wolf wrote: > [ Adding some CCs ] > > Am 06.04.2016 um 05:29 hat Jeff Cody geschrieben: > > Upon receiving an I/O error after an fsync, by default gluster will > > dump its cache. However, QEMU will retry the fsync, which is especially > > useful

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.6] crypto: Avoid memory leak on failure

2016-04-07 Thread Markus Armbruster
Max Reitz writes: > On 01.04.2016 17:57, Eric Blake wrote: >> Commit 7836857 introduced a memory leak due to invalid use of >> Error vs. visit_type_end(). If visiting the intermediate >> members fails, we clear the error and unconditionally use >> visit_end_struct() on the

Re: [Qemu-block] [PULL 48/48] iotests: Test qemu-img convert -S 0 behavior

2016-04-07 Thread Paolo Bonzini
On 29/03/2016 17:08, Kevin Wolf wrote: > From: Max Reitz > > Passing -S 0 to qemu-img convert should result in all source data being > copied to the output, even if that source data is known to be 0. The > output image should therefore have exactly the same size on disk as

Re: [Qemu-block] [PATCH for-2.6 2/2] block/gluster: prevent data loss after i/o error

2016-04-07 Thread Pranith Kumar Karampuri
+Raghavendra G who implemented this option in write-behind, to this upstream patch review discussion Pranith On 04/06/2016 06:50 PM, Kevin Wolf wrote: Am 06.04.2016 um 15:10 hat Jeff Cody geschrieben: On Wed, Apr 06, 2016 at 01:51:59PM +0200, Kevin Wolf wrote: Am 06.04.2016 um 13:41 hat

Re: [Qemu-block] [PATCH] xen: piix reuse pci generic class init function

2016-04-07 Thread John Snow
On 04/06/2016 11:48 PM, Michael S. Tsirkin wrote: > On Wed, Apr 06, 2016 at 04:56:12PM -0700, Stefano Stabellini wrote: >> On Sun, 3 Apr 2016, Michael S. Tsirkin wrote: >>> piix3_ide_xen_class_init is identical to piix3_ide_class_init >>> except it's buggy as it does not set exit and does not

Re: [Qemu-block] [PATCH v2 for-2.7 8/8] block: Drop bdrv_parent_cb_...() from bdrv_close()

2016-04-07 Thread Kevin Wolf
Am 06.04.2016 um 19:57 hat Max Reitz geschrieben: > bdrv_close() now asserts that the BDS's refcount is 0, therefore it > cannot have any parents and the bdrv_parent_cb_change_media() call is a > no-op. > > Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf

Re: [Qemu-block] [PATCH v2 for-2.7 7/8] block: Assert !bs->refcnt in bdrv_close()

2016-04-07 Thread Kevin Wolf
Am 06.04.2016 um 19:57 hat Max Reitz geschrieben: > The only caller of bdrv_close() left is bdrv_delete(). We may as well > assert that, in a way (there are some things in bdrv_close() that make > more sense under that assumption, such as the call to > bdrv_release_all_dirty_bitmaps() which in

Re: [Qemu-block] [PATCH v2 for-2.7 6/8] block: Make bdrv_open() return a BDS

2016-04-07 Thread Kevin Wolf
Am 06.04.2016 um 19:57 hat Max Reitz geschrieben: > There are no callers to bdrv_open() or bdrv_open_inherit() left that > pass a pointer to a non-NULL BDS pointer as the first argument of these > functions, so we can finally drop that parameter and just make them > return the new BDS. > >

Re: [Qemu-block] [PATCH v2 for-2.7 5/8] block: Drop bdrv_new_root()

2016-04-07 Thread Kevin Wolf
Am 06.04.2016 um 19:57 hat Max Reitz geschrieben: > By now it has become just a wrapper around bdrv_new() and it has only a > single user. Use bdrv_new() there instead and drop this function. > > Signed-off-by: Max Reitz > Reviewed-by: Alberto Garcia The

Re: [Qemu-block] [PATCH v2 for-2.7 4/8] block: Drop blk_new_with_bs()

2016-04-07 Thread Kevin Wolf
Am 06.04.2016 um 19:57 hat Max Reitz geschrieben: > Its only caller is blk_new_open(), so we can just inline it there. > > Signed-off-by: Max Reitz Maybe mention that this isn't pure code motion, but that you switch to a bdrv_open() call with a NULL BDS. Either way:

Re: [Qemu-block] [PATCH v2 for-2.7 3/8] tests: Drop BDS from test-throttle.c

2016-04-07 Thread Kevin Wolf
Am 06.04.2016 um 19:57 hat Max Reitz geschrieben: > Now that throttling has been moved to the BlockBackend level, we do not > need to create a BDS along with the BB in the I/O throttling test. > > Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf

Re: [Qemu-block] [PATCH v2 for-2.7 1/8] block: Drop useless bdrv_new() call

2016-04-07 Thread Kevin Wolf
Am 06.04.2016 um 19:57 hat Max Reitz geschrieben: > bdrv_append_temp_snapshot() uses bdrv_new() to create an empty BDS > before invoking bdrv_open() on that BDS. This is probably a relict from > when it used to do some modifications on that empty BDS, but now that is > unnecessary, so we can just

Re: [Qemu-block] [PATCH v2 for-2.7 1/8] block: Drop useless bdrv_new() call

2016-04-07 Thread Alberto Garcia
On Wed 06 Apr 2016 07:57:07 PM CEST, Max Reitz wrote: > bdrv_append_temp_snapshot() uses bdrv_new() to create an empty BDS > before invoking bdrv_open() on that BDS. This is probably a relict from > when it used to do some modifications on that empty BDS, but now that is > unnecessary, so we can

Re: [Qemu-block] [PATCH v2 for-2.7 2/8] block: Let bdrv_open_inherit() return the snapshot

2016-04-07 Thread Kevin Wolf
Am 06.04.2016 um 19:57 hat Max Reitz geschrieben: > If bdrv_open_inherit() creates a snapshot BDS and *pbs is NULL, that > snapshot BDS should be returned instead of the BDS under it. > > To this end, bdrv_append_temp_snapshot() now returns the snapshot BDS > instead of just appending it on top

Re: [Qemu-block] [PATCH] block: initialize qcrypto API at startup

2016-04-07 Thread Kevin Wolf
Am 06.04.2016 um 13:12 hat Daniel P. Berrange geschrieben: > Any programs which call the qcrypto APIs should ensure that > qcrypto_init() has been called before anything else which > can use crypto. Essentially this means right at the start > of the main method before initializing anything else. >