Re: [Qemu-block] [PATCH 07/18] throttle-groups: only start one coroutine from drained_begin

2017-05-17 Thread Alberto Garcia
On Thu 11 May 2017 04:41:57 PM CEST, Paolo Bonzini wrote: > Starting all waiting coroutines from bdrv_drain_all is unnecessary; > throttle_group_co_io_limits_intercept calls schedule_next_request as > soon as the coroutine restarts, which in turn will restart the next > request if possible. > > If

Re: [Qemu-block] [Qemu-devel] [PATCH 0/3] block: fix 'savevm' hang with -object iothread

2017-05-17 Thread Paolo Bonzini
- Original Message - > From: "Stefan Hajnoczi" > To: qemu-de...@nongnu.org > Cc: "Kevin Wolf" , "Paolo Bonzini" , > "Fam Zheng" , "Stefan > Hajnoczi" , qemu-block@nongnu.org > Sent:

Re: [Qemu-block] [Qemu-devel] [PATCH 2/3] block: use BDRV_POLL_WHILE() in bdrv_rw_vmstate()

2017-05-17 Thread Paolo Bonzini
> I'm surprised at how many separate hangs we actually had! Note that I have seen quite a few before, though I am not sure about the details and the reproducibility. The release/acquire was hidden behind RFifoLock contention callbacks instead of BDRV_POLL_WHILE. Paolo > > > > Signed-off-by:

Re: [Qemu-block] [Qemu-devel] [PATCH 3/3] migration: avoid recursive AioContext locking in save_vmstate()

2017-05-17 Thread Eric Blake
On 05/17/2017 12:09 PM, Stefan Hajnoczi wrote: > AioContext was designed to allow nested acquire/release calls. It uses > a recursive mutex so callers don't need to worry about nesting...or so > we thought. > > BDRV_POLL_WHILE() is used to wait for block I/O requests. It releases > the

Re: [Qemu-block] [Qemu-devel] [PATCH 2/3] block: use BDRV_POLL_WHILE() in bdrv_rw_vmstate()

2017-05-17 Thread Eric Blake
On 05/17/2017 12:09 PM, Stefan Hajnoczi wrote: > Calling aio_poll() directly may have been fine previously, but this is > the future, man! lol > The difference between an aio_poll() loop and > BDRV_POLL_WHILE() is that BDRV_POLL_WHILE() releases the AioContext > around aio_poll(). > > This

Re: [Qemu-block] [Qemu-devel] [PATCH 1/3] block: count bdrv_co_rw_vmstate() requests

2017-05-17 Thread Eric Blake
On 05/17/2017 12:09 PM, Stefan Hajnoczi wrote: > Call bdrv_inc/dec_in_flight() for vmstate reads/writes. This seems > unnecessary at first glance because vmstate reads/writes are done > synchronously while the guest is stopped. But we need the bdrv_wakeup() > in bdrv_dec_in_flight() so the main

[Qemu-block] [PATCH 1/3] block: count bdrv_co_rw_vmstate() requests

2017-05-17 Thread Stefan Hajnoczi
Call bdrv_inc/dec_in_flight() for vmstate reads/writes. This seems unnecessary at first glance because vmstate reads/writes are done synchronously while the guest is stopped. But we need the bdrv_wakeup() in bdrv_dec_in_flight() so the main loop sees request completion. Besides, it's cleaner to

[Qemu-block] [PATCH 3/3] migration: avoid recursive AioContext locking in save_vmstate()

2017-05-17 Thread Stefan Hajnoczi
AioContext was designed to allow nested acquire/release calls. It uses a recursive mutex so callers don't need to worry about nesting...or so we thought. BDRV_POLL_WHILE() is used to wait for block I/O requests. It releases the AioContext temporarily around aio_poll(). This gives IOThreads a

[Qemu-block] [PATCH 0/3] block: fix 'savevm' hang with -object iothread

2017-05-17 Thread Stefan Hajnoczi
The 'savevm' command hangs when -object iothread is used. See patches for details, but basically the vmstate read/write code didn't conform to the latest block layer locking rules. Stefan Hajnoczi (3): block: count bdrv_co_rw_vmstate() requests block: use BDRV_POLL_WHILE() in

[Qemu-block] [PATCH 2/3] block: use BDRV_POLL_WHILE() in bdrv_rw_vmstate()

2017-05-17 Thread Stefan Hajnoczi
Calling aio_poll() directly may have been fine previously, but this is the future, man! The difference between an aio_poll() loop and BDRV_POLL_WHILE() is that BDRV_POLL_WHILE() releases the AioContext around aio_poll(). This allows the IOThread to run fd handlers or BHs to complete the request.

[Qemu-block] [PULL 10/22] sysbus-ahci: Remove user_creatable flag

2017-05-17 Thread Eduardo Habkost
The sysbus-ahci devices are supposed to be created and wired by code from other devices, like calxeda_init() and xlnx_zynqmp_realize(), and won't work with -device. Remove the user_creatable flag from the device class. Cc: John Snow Cc: qemu-block@nongnu.org Cc: Rob Herring

[Qemu-block] [PULL 02/22] sysbus: Set user_creatable=false by default on TYPE_SYS_BUS_DEVICE

2017-05-17 Thread Eduardo Habkost
commit 33cd52b5d7b9adfd009e95f07e6c64dd88ae2a31 unset cannot_instantiate_with_device_add_yet in TYPE_SYSBUS, making all sysbus devices appear on "-device help" and lack the "no-user" flag in "info qdm". To fix this, we can set user_creatable=false by default on TYPE_SYS_BUS_DEVICE, but this

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

2017-05-17 Thread Eric Blake
On 05/17/2017 06:59 AM, Juan Quintela wrote: > Eric Blake wrote: >> 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

[Qemu-block] [PULL 06/22] pflash_cfi01: Remove user_creatable flag

2017-05-17 Thread Eduardo Habkost
TYPE_CFI_PFLASH01 devices need to be mapped by pflash_cfi01_register() (or equivalent) and can't be used with -device. Remove user_creatable from the device class. Cc: Kevin Wolf Cc: Max Reitz Cc: qemu-block@nongnu.org Cc: Laszlo Ersek

[Qemu-block] [PULL 05/22] fdc: Remove user_creatable flag from sysbus-fdc & SUNW, fdtwo

2017-05-17 Thread Eduardo Habkost
sysbus-fdc and SUNW,fdtwo devices need IRQs to be wired and mmio to be mapped, and can't be used with -device. Unset user_creatable on their device classes. Cc: John Snow Cc: Kevin Wolf Cc: Marcel Apfelbaum Cc: Max Reitz

Re: [Qemu-block] [Qemu-devel] [PATCH] qemu-iotests: Test streaming with missing job ID

2017-05-17 Thread Jeff Cody
On Mon, May 15, 2017 at 02:39:40PM +0200, Kevin Wolf wrote: > This adds a small test for the image streaming error path for failing > block_job_create(), which would have found the null pointer dereference > in commit a170a91f. > > Signed-off-by: Kevin Wolf > --- Reviewed-by:

Re: [Qemu-block] [PATCH] nvme: Add support for Controller Memory Buffers

2017-05-17 Thread Kevin Wolf
Am 17.05.2017 um 04:22 hat Stephen Bates geschrieben: > > Awesome, this looks great! > > > > Acked-by: Keith Busch > > Thanks Keith! > > I still seem to be having issues getting my patches onto the qemu-* > mailing lists. Does anyone have any idea how I go about

Re: [Qemu-block] [PULL 0/8] Block patches for curl

2017-05-17 Thread Stefan Hajnoczi
On Tue, May 16, 2017 at 11:54:12AM -0400, Jeff Cody wrote: > The following changes since commit 3a8760664d5c1a1a93c9012bdb8ac07ab8fd4b0d: > > Merge tag 'tracing-pull-request' into staging (2017-05-12 10:39:35 -0400) > > are available in the git repository at: > >

Re: [Qemu-block] [PATCH v4] qemu-img: Check for backing image if specified during create

2017-05-17 Thread Max Reitz
On 2017-05-16 10:17, Kevin Wolf wrote: > Am 15.05.2017 um 21:17 hat Max Reitz geschrieben: >> On 2017-05-15 20:41, Max Reitz wrote: >>> On 2017-05-12 21:47, John Snow wrote: On 05/12/2017 03:46 PM, Eric Blake wrote: > On 05/12/2017 01:07 PM, Max Reitz wrote: >> On 2017-05-11

Re: [Qemu-block] [PATCH] gluster: add support for PREALLOC_MODE_FALLOC

2017-05-17 Thread Niels de Vos
On Tue, May 16, 2017 at 11:42:37AM -0400, Jeff Cody wrote: > On Mon, May 15, 2017 at 09:11:36PM +0200, Niels de Vos wrote: > > Add missing support for "preallocation=falloc" to the Gluster block > > driver. This change bases its logic on that of block/file-posix.c and > > removed the

Re: [Qemu-block] [PATCH] iotests: 147: Don't test inet6 if not available

2017-05-17 Thread Kevin Wolf
Am 05.05.2017 um 12:21 hat Fam Zheng geschrieben: > This is the case in our docker tests, as we use --net=none there. Skip > this method. > > Signed-off-by: Fam Zheng Thanks, applied to the block branch. Kevin

Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: 147: Don't test inet6 if not available

2017-05-17 Thread Fam Zheng
On Fri, 05/05 11:41, Daniel P. Berrange wrote: > On Fri, May 05, 2017 at 06:21:53PM +0800, Fam Zheng wrote: > > This is the case in our docker tests, as we use --net=none there. Skip > > this method. > > > > Signed-off-by: Fam Zheng > > --- > > tests/qemu-iotests/147 | 7

Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: 147: Don't test inet6 if not available

2017-05-17 Thread Daniel P. Berrange
On Wed, May 17, 2017 at 08:10:51PM +0800, Fam Zheng wrote: > On Wed, 05/17 13:59, Kevin Wolf wrote: > > Am 17.05.2017 um 04:13 hat Fam Zheng geschrieben: > > > On Fri, 05/05 18:21, Fam Zheng wrote: > > > > This is the case in our docker tests, as we use --net=none there. Skip > > > > this method.

Re: [Qemu-block] [PATCH] qemu-iotests: Test streaming with missing job ID

2017-05-17 Thread Stefan Hajnoczi
On Mon, May 15, 2017 at 02:39:40PM +0200, Kevin Wolf wrote: > This adds a small test for the image streaming error path for failing > block_job_create(), which would have found the null pointer dereference > in commit a170a91f. > > Signed-off-by: Kevin Wolf > --- >

Re: [Qemu-block] [RFC PATCH] qemu-io: add drain/undrain cmd

2017-05-17 Thread Stefan Hajnoczi
On Mon, May 15, 2017 at 12:02:43PM +0200, Peter Lieven wrote: > I would like to add a feature to Qemu to drain all traffic from a block so > that > I can take external snaphosts without the risk to that in the middle of a > write > operation. Its meant for cases where where QGA freeze/thaw is

Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: 147: Don't test inet6 if not available

2017-05-17 Thread Fam Zheng
On Wed, 05/17 13:59, Kevin Wolf wrote: > Am 17.05.2017 um 04:13 hat Fam Zheng geschrieben: > > On Fri, 05/05 18:21, Fam Zheng wrote: > > > This is the case in our docker tests, as we use --net=none there. Skip > > > this method. > > > > Ping. Is this patch okay? > > I thought you might want to

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

2017-05-17 Thread Juan Quintela
Eric Blake wrote: > 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

Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: 147: Don't test inet6 if not available

2017-05-17 Thread Kevin Wolf
Am 17.05.2017 um 04:13 hat Fam Zheng geschrieben: > On Fri, 05/05 18:21, Fam Zheng wrote: > > This is the case in our docker tests, as we use --net=none there. Skip > > this method. > > Ping. Is this patch okay? I thought you might want to respond to Dan's comment. If you don't plan to make the

Re: [Qemu-block] [PATCH v2 08/12] dirty-bitmap: Change bdrv_get_dirty() to take bytes

2017-05-17 Thread Juan Quintela
Eric Blake wrote: > 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

Re: [Qemu-block] [PATCH v2 07/12] dirty-bitmap: Change bdrv_get_dirty_count() to report bytes

2017-05-17 Thread Juan Quintela
Eric Blake wrote: > 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

Re: [Qemu-block] [PATCH] qemu-iotests: Test streaming with missing job ID

2017-05-17 Thread Kashyap Chamarthy
On Mon, May 15, 2017 at 02:39:40PM +0200, Kevin Wolf wrote: > This adds a small test for the image streaming error path for failing > block_job_create(), which would have found the null pointer dereference > in commit a170a91f. > > Signed-off-by: Kevin Wolf > --- >