Re: [Qemu-block] [Qemu-devel] [PATCH 1/1] MAINTAINERS: Fix typo, block/stream.h -> block/stream.c

2016-03-09 Thread Fam Zheng
On Wed, 03/09 21:54, Jeff Cody wrote: > There is no block/stream.h, the intended filename is block/stream.c > instead. > > Signed-off-by: Jeff Cody > --- > MAINTAINERS | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/MAINTAINERS b/MAINTAINERS > index

[Qemu-block] [PATCH v12 1/3] Add new block driver interface to add/delete a BDS's child

2016-03-09 Thread Changlong Xie
From: Wen Congyang In some cases, we want to take a quorum child offline, and take another child online. Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei

[Qemu-block] [PATCH v12 3/3] qmp: add monitor command to add/remove a child

2016-03-09 Thread Changlong Xie
From: Wen Congyang The new QMP command name is x-blockdev-change. It's just for adding/removing quorum's child now, and doesn't support all kinds of children, all kinds of operations, nor all block drivers. So it is experimental now. Signed-off-by: Wen Congyang

[Qemu-block] [PATCH v12 0/3] qapi: child add/delete support

2016-03-09 Thread Changlong Xie
ChangLog: v11~v12: 1. Address comments from Max p1. Add R-B p2. Add R-B, remove unnecessary "endptr" "value" p3. Add R-B v10~v11: 1. Rebase to the newest codes 2. Address comment from Max Don't use contractions in error messages, p1: Remove R-Bs, and use "BdrvChild *child" in bdrv_del_child p2:

Re: [Qemu-block] [PATCH v3 1/1] block/sheepdog: fix argument passed to qemu_strtoul()

2016-03-09 Thread Jeff Cody
On Wed, Mar 02, 2016 at 11:24:42AM -0500, Jeff Cody wrote: > The function qemu_strtoul() reads 'unsigned long' sized data, > which is larger than uint32_t on 64-bit machines. > > Even though the snap_id field in the header is 32-bits, we must > accomodate the full size in qemu_strtoul(). > >

Re: [Qemu-block] [PATCH v11 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()

2016-03-09 Thread Changlong Xie
On 03/10/2016 02:11 AM, Max Reitz wrote: On 09.03.2016 04:51, Changlong Xie wrote: From: Wen Congyang Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei

Re: [Qemu-block] [Qemu-devel] [PATCH v2 3/3] vmdk: Switch to heap arrays for vmdk_parent_open

2016-03-09 Thread Fam Zheng
On Wed, 03/09 10:50, Kevin Wolf wrote: > Am 09.03.2016 um 01:43 hat Fam Zheng geschrieben: > > On Tue, 03/08 16:24, Fam Zheng wrote: > > > Signed-off-by: Fam Zheng > > > --- > > > block/vmdk.c | 17 +++-- > > > 1 file changed, 11 insertions(+), 6 deletions(-) > > >

Re: [Qemu-block] [PATCH 1/2] block/qapi: make two printf() formats literal

2016-03-09 Thread Peter Xu
On Wed, Mar 09, 2016 at 03:14:03PM -0700, Eric Blake wrote: > > +func_fprintf(f, "%*s[%i]:%c", indentation * 4, "", i, > > + composite ? '\n' : ' '); > > [The nerd in me wants to point out that you could avoid the ternary by > writing '"\n "[composite]', but that's too

[Qemu-block] [PATCH v5 11/14] qapi: Don't special-case simple union wrappers

2016-03-09 Thread Eric Blake
Simple unions were carrying a special case that hid their 'data' QMP member from the resulting C struct, via the hack method QAPISchemaObjectTypeVariant.simple_union_type(). But by using the work we started by unboxing flat union and alternate branches, coupled with the ability to visit the

Re: [Qemu-block] [PATCH v2] block/gluster: add support for SEEK_DATA/SEEK_HOLE

2016-03-09 Thread Jeff Cody
On Wed, Mar 09, 2016 at 07:12:41PM +0100, Niels de Vos wrote: > On Wed, Mar 09, 2016 at 10:46:02AM -0500, Jeff Cody wrote: > > On Wed, Mar 09, 2016 at 01:30:14PM +0100, Niels de Vos wrote: > > > GlusterFS 3.8 contains support for SEEK_DATA and SEEK_HOLE. This makes > > > it possible to detect

Re: [Qemu-block] [PATCH 2/2] block/qapi: fix unbounded stack for dump_qdict

2016-03-09 Thread Eric Blake
On 03/08/2016 10:56 PM, Peter Xu wrote: > Using heap instead of stack for better safety. > > Signed-off-by: Peter Xu > --- > block/qapi.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Eric Blake > > diff --git a/block/qapi.c

Re: [Qemu-block] [PATCH 1/2] block/qapi: make two printf() formats literal

2016-03-09 Thread Eric Blake
On 03/08/2016 10:56 PM, Peter Xu wrote: > Fix two places to use literal printf format when possible. > > Signed-off-by: Peter Xu > --- > block/qapi.c | 10 -- > 1 file changed, 4 insertions(+), 6 deletions(-) Reviewed-by: Eric Blake > > diff

Re: [Qemu-block] [PATCH v11 3/3] qmp: add monitor command to add/remove a child

2016-03-09 Thread Max Reitz
On 09.03.2016 04:51, Changlong Xie wrote: > From: Wen Congyang > > The new QMP command name is x-blockdev-change. It's just for adding/removing > quorum's child now, and doesn't support all kinds of children, all kinds of > operations, nor all block drivers. So it is

Re: [Qemu-block] [PATCH v2] block/gluster: add support for SEEK_DATA/SEEK_HOLE

2016-03-09 Thread Niels de Vos
On Wed, Mar 09, 2016 at 10:46:02AM -0500, Jeff Cody wrote: > On Wed, Mar 09, 2016 at 01:30:14PM +0100, Niels de Vos wrote: > > GlusterFS 3.8 contains support for SEEK_DATA and SEEK_HOLE. This makes > > it possible to detect sparse areas in files. > > > > Signed-off-by: Niels de Vos

Re: [Qemu-block] [PATCH v11 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()

2016-03-09 Thread Max Reitz
On 09.03.2016 04:51, Changlong Xie wrote: > From: Wen Congyang > > Signed-off-by: Wen Congyang > Signed-off-by: zhanghailiang > Signed-off-by: Gonglei > Signed-off-by: Changlong Xie

Re: [Qemu-block] [PATCH v11 1/3] Add new block driver interface to add/delete a BDS's child

2016-03-09 Thread Max Reitz
On 09.03.2016 04:51, Changlong Xie wrote: > From: Wen Congyang > > In some cases, we want to take a quorum child offline, and take > another child online. > > Signed-off-by: Wen Congyang > Signed-off-by: zhanghailiang

Re: [Qemu-block] [PATCH 4/4] iotests: Add test for QMP event rates

2016-03-09 Thread Max Reitz
On 09.03.2016 17:11, Alberto Garcia wrote: > This test verifies that the rate-limited QMP events are emitted at a > maximum rate of 1 per second as defined in monitor_qapi_event_conf in > monitor.c > > It also checks that QUORUM_REPORT_BAD events generated from different > nodes are kept in

Re: [Qemu-block] [PATCH 3/4] monitor: Use QEMU_CLOCK_VIRTUAL for the event queue in qtest mode

2016-03-09 Thread Max Reitz
On 09.03.2016 17:11, Alberto Garcia wrote: > This allows us to perform tests on the monitor queues to verify that > the rate limits are enforced. > > Signed-off-by: Alberto Garcia > --- > monitor.c | 13 ++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > >

Re: [Qemu-block] [PATCH 2/4] monitor: Separate QUORUM_REPORT_BAD events according to the node name

2016-03-09 Thread Max Reitz
On 09.03.2016 17:11, Alberto Garcia wrote: > The QUORUM_REPORT_BAD event is emitted whenever there's an I/O error > in a child of a Quorum device. This event is emitted at a maximum rate > of 1 per second. This means that an error in one of the children will > mask errors in the other children if

Re: [Qemu-block] bogus bdrv_check_request in bdrv_co_discard

2016-03-09 Thread Olaf Hering
On Wed, Mar 09, Olaf Hering wrote: > Why does the code use signed ints anyway for sectors and offset?! I have to check mainline (next week), at least this fixes mkfs for me: +++ xen-4.4.3-testing/tools/qemu-xen-dir-remote/block/raw-posix.c @@ -792,8 +792,8 @@ static BlockDriverAIOCB

Re: [Qemu-block] bogus bdrv_check_request in bdrv_co_discard

2016-03-09 Thread Olaf Hering
On Wed, Mar 09, Kevin Wolf wrote: > Removing integer overflow checks without removing the potentially > overflowing operation doesn't feel like a particularly good idea, > though. Why does the code use signed ints anyway for sectors and offset?! Olaf

[Qemu-block] [PATCH 2/4] monitor: Separate QUORUM_REPORT_BAD events according to the node name

2016-03-09 Thread Alberto Garcia
The QUORUM_REPORT_BAD event is emitted whenever there's an I/O error in a child of a Quorum device. This event is emitted at a maximum rate of 1 per second. This means that an error in one of the children will mask errors in the other children if they happen within the same 1 second interval.

[Qemu-block] [PATCH 0/4] Separate QUORUM_REPORT_BAD events according to their node name

2016-03-09 Thread Alberto Garcia
Hi, this was proposed by Eric in a recent email, but I'll summarize it here: QUORUM_REPORT_BAD events are limited to a maximum rate of 1 per second. While this is not a problem in itself, this means that an error in one a Quorum child will mask errors in the other children if they happen within

[Qemu-block] [PATCH 3/4] monitor: Use QEMU_CLOCK_VIRTUAL for the event queue in qtest mode

2016-03-09 Thread Alberto Garcia
This allows us to perform tests on the monitor queues to verify that the rate limits are enforced. Signed-off-by: Alberto Garcia --- monitor.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monitor.c index c9fe862..d689b83 100644

[Qemu-block] [PATCH 1/4] quorum: Fix crash in quorum_aio_cb()

2016-03-09 Thread Alberto Garcia
quorum_aio_cb() emits the QUORUM_REPORT_BAD event if there's an I/O error in a Quorum child. However sacb->aiocb must be correctly initialized for this to happen. read_quorum_children() and read_fifo_child() are not doing this, which results in a QEMU crash. Signed-off-by: Alberto Garcia

[Qemu-block] [PATCH 4/4] iotests: Add test for QMP event rates

2016-03-09 Thread Alberto Garcia
This test verifies that the rate-limited QMP events are emitted at a maximum rate of 1 per second as defined in monitor_qapi_event_conf in monitor.c It also checks that QUORUM_REPORT_BAD events generated from different nodes are kept in separate queues so they don't mask each other.

Re: [Qemu-block] [PATCH v2] block/gluster: add support for SEEK_DATA/SEEK_HOLE

2016-03-09 Thread Jeff Cody
On Wed, Mar 09, 2016 at 01:30:14PM +0100, Niels de Vos wrote: > GlusterFS 3.8 contains support for SEEK_DATA and SEEK_HOLE. This makes > it possible to detect sparse areas in files. > > Signed-off-by: Niels de Vos > > --- > Tested by compiling and running "qemu-img map

Re: [Qemu-block] [PATCH] qed: fix bdrv_qed_drain

2016-03-09 Thread Stefan Hajnoczi
On Tue, Mar 08, 2016 at 10:58:47AM +0100, Kevin Wolf wrote: > Am 07.03.2016 um 21:56 hat Stefan Hajnoczi geschrieben: > > On Mon, Mar 07, 2016 at 05:57:41PM +0100, Kevin Wolf wrote: > > > Am 23.02.2016 um 14:54 hat Paolo Bonzini geschrieben: > > > > > > > > > > > > On 23/02/2016 13:49, Fam Zheng

Re: [Qemu-block] [PATCH v10 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()

2016-03-09 Thread Max Reitz
On 08.03.2016 03:57, Changlong Xie wrote: > On 03/08/2016 12:02 AM, Max Reitz wrote: >> On 07.03.2016 17:02, Eric Blake wrote: >>> On 03/05/2016 11:13 AM, Max Reitz wrote: >>> > +index = atoi(child->name + 9); Optional: Assert absence of an error: >>> >>> Indeed, atoi() is

Re: [Qemu-block] bogus bdrv_check_request in bdrv_co_discard

2016-03-09 Thread Kevin Wolf
Am 09.03.2016 um 15:45 hat Olaf Hering geschrieben: > On Wed, Mar 09, Paolo Bonzini wrote: > > > It probably should range check max_unmap_size and max_io_size against > > BDRV_REQUEST_MAX_SECTORS, and reject anything bigger than that, though. > > Are you sure? Shouldnt the only check be if

[Qemu-block] bogus bdrv_check_request in bdrv_co_discard

2016-03-09 Thread Olaf Hering
What is the purpose of the bdrv_check_request() call in bdrv_co_discard? It seems a frontend cant possibly know what the limit is in the qemu-of-the-day, I found no interface to propagate BDRV_REQUEST_MAX_SECTORS into the guest. I think to handle nb_sectors > BDRV_REQUEST_MAX_SECTORS

Re: [Qemu-block] [Qemu-devel] [PATCH 0/3] Early release of -drive QemuOpts

2016-03-09 Thread Markus Armbruster
Kevin Wolf writes: > Am 09.03.2016 um 13:20 hat Paolo Bonzini geschrieben: >> On 22/02/2016 15:39, Paolo Bonzini wrote: >> > In short, this patch gets rid of blockdev_mark_auto_del and >> > blockdev_auto_del. >> > >> > With these patches, it is possible to create a new -drive

[Qemu-block] [PATCH v2] block/gluster: add support for SEEK_DATA/SEEK_HOLE

2016-03-09 Thread Niels de Vos
GlusterFS 3.8 contains support for SEEK_DATA and SEEK_HOLE. This makes it possible to detect sparse areas in files. Signed-off-by: Niels de Vos --- Tested by compiling and running "qemu-img map gluster://..." with a build of the current master branch of glusterfs. Using a

Re: [Qemu-block] [PATCH 0/3] Early release of -drive QemuOpts

2016-03-09 Thread Kevin Wolf
Am 09.03.2016 um 13:20 hat Paolo Bonzini geschrieben: > On 22/02/2016 15:39, Paolo Bonzini wrote: > > In short, this patch gets rid of blockdev_mark_auto_del and > > blockdev_auto_del. > > > > With these patches, it is possible to create a new -drive with the same > > id as soon as the

Re: [Qemu-block] bogus bdrv_check_request in bdrv_co_discard

2016-03-09 Thread Paolo Bonzini
On 09/03/2016 13:11, Olaf Hering wrote: > What is the purpose of the bdrv_check_request() call in bdrv_co_discard? > > It seems a frontend cant possibly know what the limit is in the > qemu-of-the-day, I found no interface to propagate > BDRV_REQUEST_MAX_SECTORS into the guest. It depends on

Re: [Qemu-block] [PATCH 01/11] block: Use writeback in .bdrv_create() implementations

2016-03-09 Thread Kevin Wolf
Am 09.03.2016 um 13:14 hat Paolo Bonzini geschrieben: > > > On 08/03/2016 17:34, Kevin Wolf wrote: > > There's no reason to use a writethrough cache mode while creating an > > image. > > There's no reason to do flushes in fact, so you could use > BDRV_O_NO_FLUSH too. :) That's true. On the

Re: [Qemu-block] [PATCH 0/3] Early release of -drive QemuOpts

2016-03-09 Thread Paolo Bonzini
On 22/02/2016 15:39, Paolo Bonzini wrote: > In short, this patch gets rid of blockdev_mark_auto_del and > blockdev_auto_del. > > With these patches, it is possible to create a new -drive with the same > id as soon as the DEVICE_DELETED event is delivered (which equals to > unrealize). > > I'm

Re: [Qemu-block] [PATCH 01/11] block: Use writeback in .bdrv_create() implementations

2016-03-09 Thread Paolo Bonzini
On 08/03/2016 17:34, Kevin Wolf wrote: > There's no reason to use a writethrough cache mode while creating an > image. There's no reason to do flushes in fact, so you could use BDRV_O_NO_FLUSH too. :) Paolo > Signed-off-by: Kevin Wolf > --- > block/parallels.c | 3 ++- >

Re: [Qemu-block] [PATCH 0/2] block: drive_add/del without BlockBackend

2016-03-09 Thread Kevin Wolf
Am 23.02.2016 um 18:16 hat Kevin Wolf geschrieben: > See patch 1 for the detailed description why this is needed. The short > version is that libvirt needs to enable detect-zeroes on a mirror > target. > > Peter, can you please check if this provides what you need? I checked > whether I could do

Re: [Qemu-block] [Qemu-devel] [PATCH v15 8/9] Implement new driver for block replication

2016-03-09 Thread Changlong Xie
On 03/05/2016 01:53 AM, Stefan Hajnoczi wrote: On Fri, Feb 05, 2016 at 12:18:07PM +0800, Changlong Xie wrote: +static void secondary_do_checkpoint(BDRVReplicationState *s, Error **errp) +{ +Error *local_err = NULL; +int ret; + +if (!s->secondary_disk->bs->job) { +

Re: [Qemu-block] [Qemu-devel] [PATCH v2 3/3] vmdk: Switch to heap arrays for vmdk_parent_open

2016-03-09 Thread Kevin Wolf
Am 09.03.2016 um 01:43 hat Fam Zheng geschrieben: > On Tue, 03/08 16:24, Fam Zheng wrote: > > Signed-off-by: Fam Zheng > > --- > > block/vmdk.c | 17 +++-- > > 1 file changed, 11 insertions(+), 6 deletions(-) > > > > diff --git a/block/vmdk.c b/block/vmdk.c > >

Re: [Qemu-block] [Qemu-devel] [PATCH 13/16] block: only call aio_poll from iothread

2016-03-09 Thread Fam Zheng
On Wed, 03/09 10:10, Paolo Bonzini wrote: > > > On 09/03/2016 09:30, Fam Zheng wrote: > > > -aio_poll(bdrv_get_aio_context(bs), true); > > > +if (aio_context_in_iothread(ctx)) { > > > +/* This case should not occur at all, except for the > > > + * main

Re: [Qemu-block] [Qemu-devel] [PATCH 13/16] block: only call aio_poll from iothread

2016-03-09 Thread Paolo Bonzini
On 09/03/2016 09:30, Fam Zheng wrote: > > -aio_poll(bdrv_get_aio_context(bs), true); > > +if (aio_context_in_iothread(ctx)) { > > +/* This case should not occur at all, except for the > > + * main thread. > > + */ > > Maybe assert ctx ==

Re: [Qemu-block] [Qemu-devel] [PATCH 00/16] AioContext fine-grained locking, part 1 of 3, including bdrv_drain rewrite

2016-03-09 Thread Fam Zheng
On Tue, 02/16 18:56, Paolo Bonzini wrote: > So the fine-grained locking series has grown from 2 parts to 3... > > This first part stops where we remove RFifoLock. Modulo to the minor comments I had: Reviewed-by: Fam Zheng

Re: [Qemu-block] [PATCH 06/16] block: add BDS field to count in-flight requests

2016-03-09 Thread Fam Zheng
On Wed, 03/09 09:22, Paolo Bonzini wrote: > > > On 09/03/2016 09:00, Fam Zheng wrote: > >> > On 09/03/2016 04:35, Fam Zheng wrote: > > > >> > enum BdrvTrackedRequestType { > > > >> > BDRV_TRACKED_READ, > > > >> > BDRV_TRACKED_WRITE, > > > >> > -BDRV_TRACKED_FLUSH,

Re: [Qemu-block] [Qemu-devel] [PATCH 13/16] block: only call aio_poll from iothread

2016-03-09 Thread Fam Zheng
On Tue, 02/16 18:56, Paolo Bonzini wrote: > aio_poll is not thread safe; for example bdrv_drain can hang if > the last in-flight I/O operation is completed in the I/O thread after > the main thread has checked bs->in_flight. > > The bug remains latent as long as all of it is called within >

Re: [Qemu-block] [PATCH 06/16] block: add BDS field to count in-flight requests

2016-03-09 Thread Paolo Bonzini
On 09/03/2016 09:00, Fam Zheng wrote: >> > On 09/03/2016 04:35, Fam Zheng wrote: > > >> > enum BdrvTrackedRequestType { > > >> > BDRV_TRACKED_READ, > > >> > BDRV_TRACKED_WRITE, > > >> > -BDRV_TRACKED_FLUSH, > > >> > -BDRV_TRACKED_IOCTL, > > >> >

Re: [Qemu-block] [Qemu-devel] [PATCH 09/16] block: wait for all pending I/O when doing synchronous requests

2016-03-09 Thread Paolo Bonzini
On 09/03/2016 09:13, Fam Zheng wrote: >> > @@ -352,7 +352,9 @@ static void qed_start_need_check_timer(BDRVQEDState *s) >> > static void qed_cancel_need_check_timer(BDRVQEDState *s) >> > { >> > trace_qed_cancel_need_check_timer(s); >> > -timer_del(s->need_check_timer); >> > +if

Re: [Qemu-block] [Qemu-devel] [PATCH 06/16] block: add BDS field to count in-flight requests

2016-03-09 Thread Fam Zheng
On Wed, 03/09 08:43, Paolo Bonzini wrote: > > > On 09/03/2016 04:35, Fam Zheng wrote: > >> > enum BdrvTrackedRequestType { > >> > BDRV_TRACKED_READ, > >> > BDRV_TRACKED_WRITE, > >> > -BDRV_TRACKED_FLUSH, > >> > -BDRV_TRACKED_IOCTL, > >> > BDRV_TRACKED_DISCARD, > > Okay,