[Qemu-block] [PATCH] hw/ide/ahci.c: Fix shift left into sign bit

2015-10-16 Thread Peter Maydell
Avoid undefined behaviour from shifting left into the sign bit: hw/ide/ahci.c:551:36: runtime error: left shift of 255 by 24 places cannot be represented in type 'int' (Unfortunately C's promotion rules mean that in the expression "some_uint8_t_variable << 24" the LHS gets promoted to signed

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Laszlo Ersek
On 10/16/15 13:34, Fabio Fantoni wrote: > Il 16/10/2015 12:47, Stefano Stabellini ha scritto: >> On Fri, 16 Oct 2015, Fabio Fantoni wrote: >>> Il 16/10/2015 12:13, Anthony PERARD ha scritto: On Fri, Oct 16, 2015 at 10:32:44AM +0200, Fabio Fantoni wrote: > Il 15/10/2015 20:02, Anthony

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Kevin Wolf
Am 16.10.2015 um 18:53 hat Paul Durrant geschrieben: > > > > > > Just tell your admin what virtual hardware you really need. (Or tell > > > > > > them to give you a proper interface to configure your VMs yourself.) > > > > > > > > > > > > > > > > My point is that the virtual hardware that the OS

Re: [Qemu-block] [Qemu-devel] [PATCH] hw/ide/ahci.c: Fix shift left into sign bit

2015-10-16 Thread John Snow
On 10/16/2015 01:48 PM, Peter Maydell wrote: > Avoid undefined behaviour from shifting left into the sign bit: > > hw/ide/ahci.c:551:36: runtime error: left shift of 255 by 24 places cannot be > represented in type 'int' > > (Unfortunately C's promotion rules mean that in the expression >

Re: [Qemu-block] [PATCH] block: fix memory leak in early exit

2015-10-16 Thread Alberto Garcia
On Thu 15 Oct 2015 05:54:27 PM CEST, Stefan Hajnoczi wrote: > The stream block job has two early exit code paths. They do not free > s->backing_file_str. > > Also, the early exits rely on the fact that the coroutine hasn't yielded > yet and was launched from the main

Re: [Qemu-block] [PATCH v8 03/11] block: never cancel a streaming job without running stream_complete()

2015-10-16 Thread Stefan Hajnoczi
On Tue, Jun 23, 2015 at 12:32:18AM +0300, Alberto Garcia wrote: > We need to call stream_complete() in order to do all the necessary > clean-ups, even if there's an early failure. At the moment it's only > useful to make sure that s->backing_file_str is not leaked, but it > will become more

Re: [Qemu-block] [Qemu-devel] [Xen-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Laszlo Ersek
On 10/16/15 04:38, Kevin O'Connor wrote: > On Fri, Oct 16, 2015 at 01:10:54AM +0200, Laszlo Ersek wrote: >> On 10/14/15 13:27, Ian Campbell wrote: >>> On Wed, 2015-10-14 at 12:06 +0100, Stefano Stabellini wrote: > Can't you just teach SeaBIOS how to deal with your PV disks and then > only

[Qemu-block] [PATCH v6 2/4] quorum: implement bdrv_add_child() and bdrv_del_child()

2015-10-16 Thread Wen Congyang
Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei --- block.c | 6 +++--- block/quorum.c| 59 +--

Re: [Qemu-block] [Qemu-devel] [Xen-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Stefano Stabellini
On Fri, 16 Oct 2015, Laszlo Ersek wrote: > On 10/16/15 11:06, Stefano Stabellini wrote: > > On Thu, 15 Oct 2015, Kevin O'Connor wrote: > >> On Fri, Oct 16, 2015 at 01:10:54AM +0200, Laszlo Ersek wrote: > >>> On 10/14/15 13:27, Ian Campbell wrote: > On Wed, 2015-10-14 at 12:06 +0100, Stefano

[Qemu-block] [PATCH v3 06/12] block: Add "drained begin/end" for transactional external snapshot

2015-10-16 Thread Fam Zheng
This ensures the atomicity of the transaction by avoiding processing of external requests such as those from ioeventfd. Signed-off-by: Fam Zheng --- blockdev.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index

[Qemu-block] [PATCH v3 05/12] block: Introduce "drained begin/end" API

2015-10-16 Thread Fam Zheng
The semantics is that after bdrv_drained_begin(bs), bs will not get new external requests until the matching bdrv_drained_end(bs). Signed-off-by: Fam Zheng --- block.c | 2 ++ block/io.c| 17 + include/block/block.h | 19

Re: [Qemu-block] [PATCH v2 3/3] virtio-blk: switch off scsi-passthrough by default

2015-10-16 Thread Christian Borntraeger
Am 16.10.2015 um 12:25 schrieb Cornelia Huck: > Devices that are compliant with virtio-1 do not support scsi > passthrough any more (and it has not been a recommended setup > anyway for quite some time). To avoid having to switch it off > explicitly in newer qemus that turn on virtio-1 by default,

[Qemu-block] [PATCH v6 4/4] hmp: add monitor command to add/remove a child

2015-10-16 Thread Wen Congyang
The new command is blockdev_change. It does the same thing as the QMP command x-blockdev-change. Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei Cc: Luiz Capitulino

[Qemu-block] [PATCH v6 0/4] qapi: child add/delete support

2015-10-16 Thread Wen Congyang
If quorum's child is broken, we can use mirror job to replace it. But sometimes, the user only need to remove the broken child, and add it later when the problem is fixed. It is based on the Kevin's bdrv_swap() related patch: http://lists.nongnu.org/archive/html/qemu-devel/2015-10/msg02152.html

[Qemu-block] [PATCH v3 07/12] block: Add "drained begin/end" for transactional backup

2015-10-16 Thread Fam Zheng
This ensures the atomicity of the transaction by avoiding processing of external requests such as those from ioeventfd. Move the assignment to state->bs up right after bdrv_drained_begin, so that we can use it in the clean callback. The abort callback will still check bs->job and state->job, so

[Qemu-block] [PATCH v3 02/12] nbd: Mark fd handlers client type as "external"

2015-10-16 Thread Fam Zheng
So we could distinguish it from internal used fds, thus avoid handling unwanted events in nested aio polls. Signed-off-by: Fam Zheng --- nbd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nbd.c b/nbd.c index 32a1f66..b599e62 100644 --- a/nbd.c +++

[Qemu-block] [PATCH] virtio-blk: switch off scsi-passthrough by default

2015-10-16 Thread Cornelia Huck
Devices that are compliant with virtio-1 do not support scsi passthrough any more (and it has not been a recommended setup anyway for quite some time). To avoid having to switch it off explicitly in newer qemus that turn on virtio-1 by default, let's switch the default to scsi=false for 2.5.

Re: [Qemu-block] [PATCH] virtio-blk: switch off scsi-passthrough by default

2015-10-16 Thread Paolo Bonzini
On 16/10/2015 10:54, Cornelia Huck wrote: > On Fri, 16 Oct 2015 10:46:31 +0200 > Paolo Bonzini wrote: > >> >> >> On 16/10/2015 10:41, Paolo Bonzini wrote: >>> >>> >>> On 16/10/2015 10:40, Cornelia Huck wrote: --- a/hw/s390x/s390-virtio-ccw.c +++

Re: [Qemu-block] [PATCH v2 2/2] aio: Introduce aio-epoll.c

2015-10-16 Thread Stefan Hajnoczi
On Tue, Oct 13, 2015 at 07:10:55PM +0800, Fam Zheng wrote: > +static bool aio_epoll_try_enable(AioContext *ctx) > +{ > +AioHandler *node; > +struct epoll_event event; > +if (!ctx->epoll_available) { > +return false; > +} Why check this here since aio_epoll_check_poll()

Re: [Qemu-block] [Qemu-devel] [Xen-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Laszlo Ersek
On 10/16/15 11:06, Stefano Stabellini wrote: > On Thu, 15 Oct 2015, Kevin O'Connor wrote: >> On Fri, Oct 16, 2015 at 01:10:54AM +0200, Laszlo Ersek wrote: >>> On 10/14/15 13:27, Ian Campbell wrote: On Wed, 2015-10-14 at 12:06 +0100, Stefano Stabellini wrote: >> Can't you just teach

Re: [Qemu-block] [PATCH v2 06/22] block: Add "supports_stats" field to BlockStats

2015-10-16 Thread Alberto Garcia
On Thu 15 Oct 2015 04:58:22 PM CEST, Stefan Hajnoczi wrote: >> > If I/O accounting isn't being used then all fields will be 0? >> >> Yes, but there's no way to tell if that happens because I/O >> accounting is not supported or because there hasn't been any I/O yet. >> >> There's one additional

[Qemu-block] [PATCH v3 04/12] aio: introduce aio_{disable, enable}_external

2015-10-16 Thread Fam Zheng
Signed-off-by: Fam Zheng --- aio-posix.c | 3 ++- aio-win32.c | 3 ++- include/block/aio.h | 37 + 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/aio-posix.c b/aio-posix.c index f0f9122..0467f23 100644 ---

Re: [Qemu-block] [PATCH v2 2/2] aio: Introduce aio-epoll.c

2015-10-16 Thread Fam Zheng
On Fri, 10/16 11:32, Stefan Hajnoczi wrote: > On Tue, Oct 13, 2015 at 07:10:55PM +0800, Fam Zheng wrote: > > +static bool aio_epoll_try_enable(AioContext *ctx) > > +{ > > +AioHandler *node; > > +struct epoll_event event; > > +if (!ctx->epoll_available) { > > +return false; > >

Re: [Qemu-block] [PATCH v2 3/3] virtio-blk: switch off scsi-passthrough by default

2015-10-16 Thread Cornelia Huck
On Fri, 16 Oct 2015 12:32:52 +0200 Christian Borntraeger wrote: > Am 16.10.2015 um 12:25 schrieb Cornelia Huck: > > Devices that are compliant with virtio-1 do not support scsi > > passthrough any more (and it has not been a recommended setup > > anyway for quite some

Re: [Qemu-block] [PATCH] block: fix memory leak in early exit

2015-10-16 Thread Stefan Hajnoczi
On Fri, Oct 16, 2015 at 08:58:12AM +0200, Alberto Garcia wrote: > On Thu 15 Oct 2015 05:54:27 PM CEST, Stefan Hajnoczi > wrote: > > The stream block job has two early exit code paths. They do not free > > s->backing_file_str. > > > > Also, the early exits rely on the fact

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

2015-10-16 Thread Wen Congyang
The new QMP command name is x-blockdev-change. It justs for adding/removing quorum's child now, and don't support all kinds of children, all kinds of operations, nor all block drivers. So it is experimental now. Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang

Re: [Qemu-block] [Qemu-devel] [Xen-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Stefano Stabellini
On Thu, 15 Oct 2015, Kevin O'Connor wrote: > On Fri, Oct 16, 2015 at 01:10:54AM +0200, Laszlo Ersek wrote: > > On 10/14/15 13:27, Ian Campbell wrote: > > > On Wed, 2015-10-14 at 12:06 +0100, Stefano Stabellini wrote: > > >>> Can't you just teach SeaBIOS how to deal with your PV disks and then > >

Re: [Qemu-block] [Qemu-devel] [Xen-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Ian Campbell
On Fri, 2015-10-16 at 10:06 +0100, Stefano Stabellini wrote: > > What's the reason for the "stumbling block" that requires the BIOS to > > tear down the Xen ring prior to the OS being able to replace it? The > > BIOS disk calls are all synchronous, so the ring wont be active when > > the OS

Re: [Qemu-block] [PATCH] virtio-blk: switch off scsi-passthrough by default

2015-10-16 Thread Paolo Bonzini
On 16/10/2015 10:40, Cornelia Huck wrote: > --- a/hw/s390x/s390-virtio-ccw.c > +++ b/hw/s390x/s390-virtio-ccw.c > @@ -272,6 +272,10 @@ static const TypeInfo ccw_machine_info = { > .driver = "vhost-scsi-ccw",\ > .property = "max_revision",\ > .value=

Re: [Qemu-block] [PATCH] virtio-blk: switch off scsi-passthrough by default

2015-10-16 Thread Cornelia Huck
On Fri, 16 Oct 2015 10:46:31 +0200 Paolo Bonzini wrote: > > > On 16/10/2015 10:41, Paolo Bonzini wrote: > > > > > > On 16/10/2015 10:40, Cornelia Huck wrote: > >> --- a/hw/s390x/s390-virtio-ccw.c > >> +++ b/hw/s390x/s390-virtio-ccw.c > >> @@ -272,6 +272,10 @@ static

Re: [Qemu-block] [PATCH v2 1/3] s390x: include HW_COMPAT_* props

2015-10-16 Thread Christian Borntraeger
Am 16.10.2015 um 12:25 schrieb Cornelia Huck: > We want to inherit generic hw compat as well. > > Signed-off-by: Cornelia Huck > --- > hw/s390x/s390-virtio-ccw.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/hw/s390x/s390-virtio-ccw.c

Re: [Qemu-block] [Qemu-devel] [PATCH 1/5] ide/atapi: make PIO read requests async

2015-10-16 Thread Peter Lieven
Am 14.10.2015 um 20:21 schrieb John Snow: > > On 10/14/2015 02:19 PM, Peter Lieven wrote: >> Am 08.10.2015 um 18:44 schrieb John Snow: >>> On 10/08/2015 08:06 AM, Peter Lieven wrote: Hi all, short summary from my side. The whole thing seems to get complicated, let me explain

Re: [Qemu-block] [PATCH] virtio-blk: switch off scsi-passthrough by default

2015-10-16 Thread Paolo Bonzini
On 16/10/2015 10:41, Paolo Bonzini wrote: > > > On 16/10/2015 10:40, Cornelia Huck wrote: >> --- a/hw/s390x/s390-virtio-ccw.c >> +++ b/hw/s390x/s390-virtio-ccw.c >> @@ -272,6 +272,10 @@ static const TypeInfo ccw_machine_info = { >> .driver = "vhost-scsi-ccw",\ >>

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Fabio Fantoni
Il 16/10/2015 12:13, Anthony PERARD ha scritto: On Fri, Oct 16, 2015 at 10:32:44AM +0200, Fabio Fantoni wrote: Il 15/10/2015 20:02, Anthony PERARD ha scritto: On Thu, Oct 15, 2015 at 06:27:17PM +0200, Fabio Fantoni wrote: Il 14/10/2015 13:06, Stefano Stabellini ha scritto: I would suggest

[Qemu-block] [PATCH v2 3/3] virtio-blk: switch off scsi-passthrough by default

2015-10-16 Thread Cornelia Huck
Devices that are compliant with virtio-1 do not support scsi passthrough any more (and it has not been a recommended setup anyway for quite some time). To avoid having to switch it off explicitly in newer qemus that turn on virtio-1 by default, let's switch the default to scsi=false for 2.5.

[Qemu-block] [PATCH v2 0/3] virtio-blk: no scsi-passthrough by default

2015-10-16 Thread Cornelia Huck
Lightly tested on s390x. Changes v1->v2: - have the s390x compat hander include HW_COMPAT - prepare the pseries 2.4 compat handler - switch compat property at virtio-blk-device instead of the transport level Cornelia Huck (3): s390x: include HW_COMPAT_* props ppc/spapr: add 2.4 compat

[Qemu-block] [PATCH v2 2/3] ppc/spapr: add 2.4 compat props

2015-10-16 Thread Cornelia Huck
HW_COMPAT_2_4 will become non-empty: prepare for it. Signed-off-by: Cornelia Huck --- hw/ppc/spapr.c | 9 + 1 file changed, 9 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index d1b0e53..c216e2c 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@

[Qemu-block] [PATCH] blkdebug: Don't confuse image as backing file

2015-10-16 Thread Fam Zheng
The word "backing file" nowadays refers to the backing_hd in the external snapshot sense (i.e. bs->backing_hd), instead of the file sense (bs->file). Correct the comment to use the right term. Signed-off-by: Fam Zheng --- block/blkdebug.c | 2 +- 1 file changed, 1 insertion(+),

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Stefano Stabellini
On Fri, 16 Oct 2015, Fabio Fantoni wrote: > Il 16/10/2015 12:13, Anthony PERARD ha scritto: > > On Fri, Oct 16, 2015 at 10:32:44AM +0200, Fabio Fantoni wrote: > > > Il 15/10/2015 20:02, Anthony PERARD ha scritto: > > > > On Thu, Oct 15, 2015 at 06:27:17PM +0200, Fabio Fantoni wrote: > > > > > Il

[Qemu-block] [PATCH v3 09/12] block: Add "drained begin/end" for internal snapshot

2015-10-16 Thread Fam Zheng
This ensures the atomicity of the transaction by avoiding processing of external requests such as those from ioeventfd. state->bs is assigned right after bdrv_drained_begin. Because it was used as the flag for deletion or not in abort, now we need a separate flag - InternalSnapshotState.created.

Re: [Qemu-block] [PATCH v2 0/3] virtio-blk: no scsi-passthrough by default

2015-10-16 Thread Paolo Bonzini
On 16/10/2015 12:25, Cornelia Huck wrote: > Lightly tested on s390x. > > Changes v1->v2: > - have the s390x compat hander include HW_COMPAT > - prepare the pseries 2.4 compat handler > - switch compat property at virtio-blk-device instead of the > transport level > > Cornelia Huck (3): >

Re: [Qemu-block] [PATCH] block: fix memory leak in early exit

2015-10-16 Thread Jeff Cody
On Fri, Oct 16, 2015 at 10:37:17AM +0200, Stefan Hajnoczi wrote: > On Fri, Oct 16, 2015 at 08:58:12AM +0200, Alberto Garcia wrote: > > On Thu 15 Oct 2015 05:54:27 PM CEST, Stefan Hajnoczi > > wrote: > > > The stream block job has two early exit code paths. They do not free

[Qemu-block] [PATCH v3 12/12] tests: Add test case for aio_disable_external

2015-10-16 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/test-aio.c | 24 1 file changed, 24 insertions(+) diff --git a/tests/test-aio.c b/tests/test-aio.c index 03cd45d..1623803 100644 --- a/tests/test-aio.c +++ b/tests/test-aio.c @@ -374,6 +374,29 @@ static void

[Qemu-block] [PATCH v3 11/12] qed: Implement .bdrv_drain

2015-10-16 Thread Fam Zheng
The "need_check_timer" is used to clear the "NEED_CHECK" flag in the image header after a grace period once metadata update has finished. In compliance to the bdrv_drain semantics we should make sure it remains deleted once .bdrv_drain is called. Call the qed_need_check_timer_cb manually to

[Qemu-block] [PATCH v3 08/12] block: Add "drained begin/end" for transactional blockdev-backup

2015-10-16 Thread Fam Zheng
Similar to the previous patch, make sure that external events are not dispatched during transaction operations. Signed-off-by: Fam Zheng --- blockdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/blockdev.c b/blockdev.c index 232bc21..015afbf 100644

[Qemu-block] [PATCH v2 1/3] s390x: include HW_COMPAT_* props

2015-10-16 Thread Cornelia Huck
We want to inherit generic hw compat as well. Signed-off-by: Cornelia Huck --- hw/s390x/s390-virtio-ccw.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 20883ff..d09d867 100644 ---

Re: [Qemu-block] [Qemu-devel] [PATCH] blkdebug: Don't confuse image as backing file

2015-10-16 Thread Eric Blake
On 10/16/2015 04:46 AM, Fam Zheng wrote: > The word "backing file" nowadays refers to the backing_hd in the > external snapshot sense (i.e. bs->backing_hd), instead of the file sense > (bs->file). Correct the comment to use the right term. > > Signed-off-by: Fam Zheng > --- >

[Qemu-block] [PATCH v3 00/12] block: Protect nested event loop with bdrv_drained_begin and bdrv_drained_end

2015-10-16 Thread Fam Zheng
v3: Call bdrv_drain unconditionally in bdrv_drained_begin. Document the internal I/O implications between bdrv_drain_begin and end. The nested aio_poll()'s in block layer has a bug that new r/w requests from ioeventfds and nbd exports are processed, which might break the caller's semantics

Re: [Qemu-block] [PATCH v10 08/10] Implement new driver for block replication

2015-10-16 Thread Stefan Hajnoczi
On Fri, Oct 16, 2015 at 10:22:05AM +0800, Wen Congyang wrote: > On 10/15/2015 10:55 PM, Stefan Hajnoczi wrote: > > On Thu, Oct 15, 2015 at 10:19:17AM +0800, Wen Congyang wrote: > >> On 10/14/2015 10:27 PM, Stefan Hajnoczi wrote: > >>> On Tue, Oct 13, 2015 at 05:08:17PM +0800, Wen Congyang wrote: >

Re: [Qemu-block] [Qemu-devel] [RFC] transactions: add transaction-wide property

2015-10-16 Thread Stefan Hajnoczi
On Mon, Oct 12, 2015 at 12:50:20PM -0400, John Snow wrote: > Ping -- any consensus on how we should implement the "do-or-die" > argument for transactions that start block jobs? :) > > This patch may look a little hokey in how it boxes arguments, but I can > re-do it on top of Eric Blake's very

Re: [Qemu-block] [PATCH v2 3/3] virtio-blk: switch off scsi-passthrough by default

2015-10-16 Thread Christian Borntraeger
Am 16.10.2015 um 12:44 schrieb Cornelia Huck: > On Fri, 16 Oct 2015 12:32:52 +0200 > Christian Borntraeger wrote: > >> Am 16.10.2015 um 12:25 schrieb Cornelia Huck: >>> Devices that are compliant with virtio-1 do not support scsi >>> passthrough any more (and it has not

[Qemu-block] [PATCH v3 01/12] aio: Add "is_external" flag for event handlers

2015-10-16 Thread Fam Zheng
All callers pass in false, and the real external ones will switch to true in coming patches. Signed-off-by: Fam Zheng --- aio-posix.c | 6 - aio-win32.c | 5 async.c | 3 ++- block/curl.c

[Qemu-block] [PATCH v3 10/12] block: Introduce BlockDriver.bdrv_drain callback

2015-10-16 Thread Fam Zheng
Drivers can have internal request sources that generate IO, like the need_check_timer in QED. Since we want quiesced periods that contain nested event loops in block layer, we need to have a way to disable such event sources. Block drivers must implement the "bdrv_drain" callback if it has any

[Qemu-block] [PATCH v3 03/12] dataplane: Mark host notifiers' client type as "external"

2015-10-16 Thread Fam Zheng
They will be excluded by type in the nested event loops in block layer, so that unwanted events won't be processed there. Signed-off-by: Fam Zheng --- hw/block/dataplane/virtio-blk.c | 5 ++--- hw/scsi/virtio-scsi-dataplane.c | 18 -- 2 files changed, 10

Re: [Qemu-block] [PATCH] blkdebug: Don't confuse image as backing file

2015-10-16 Thread Alberto Garcia
On Fri 16 Oct 2015 12:46:04 PM CEST, Fam Zheng wrote: > The word "backing file" nowadays refers to the backing_hd in the > external snapshot sense (i.e. bs->backing_hd), instead of the file sense > (bs->file). Correct the comment to use the right term. > > Signed-off-by: Fam Zheng

Re: [Qemu-block] [Qemu-devel] [Xen-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Kevin O'Connor
On Fri, Oct 16, 2015 at 10:06:48AM +0100, Stefano Stabellini wrote: > On Thu, 15 Oct 2015, Kevin O'Connor wrote: > > What's the reason for the "stumbling block" that requires the BIOS to > > tear down the Xen ring prior to the OS being able to replace it? The > > BIOS disk calls are all

Re: [Qemu-block] [PATCH] blkdebug: Don't confuse image as backing file

2015-10-16 Thread Kevin Wolf
Am 16.10.2015 um 12:46 hat Fam Zheng geschrieben: > The word "backing file" nowadays refers to the backing_hd in the > external snapshot sense (i.e. bs->backing_hd), instead of the file sense > (bs->file). Correct the comment to use the right term. > > Signed-off-by: Fam Zheng

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Kevin Wolf
Am 14.10.2015 um 14:48 hat Paul Durrant geschrieben: > > -Original Message- > > From: Fabio Fantoni [mailto:fabio.fant...@m2r.biz] > > Sent: 14 October 2015 12:12 > > To: Kevin Wolf; Stefano Stabellini > > Cc: John Snow; Anthony Perard; qemu-de...@nongnu.org; xen- > > de...@lists.xen.org;

[Qemu-block] [PULL 16/29] block: Introduce parents list

2015-10-16 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi --- block.c | 3 +++ include/block/block_int.h | 2 ++ 2 files changed, 5 insertions(+) diff --git

[Qemu-block] [PULL 08/29] quorum: Convert to BdrvChild

2015-10-16 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia Reviewed-by: Fam Zheng Reviewed-by: Jeff Cody Reviewed-by: Stefan Hajnoczi --- block/quorum.c | 65

[Qemu-block] [PULL 13/29] block: Split bdrv_move_feature_fields()

2015-10-16 Thread Kevin Wolf
After bdrv_swap(), some fields must be moved back to their original BDS to compensate for the effects that a swap of the contents of the objects has while keeping the old addresses. Other fields must be moved back because they should logically be moved and must stay on top When replacing

[Qemu-block] [PULL 05/29] block: Introduce BDS.file_child

2015-10-16 Thread Kevin Wolf
Store the BdrvChild for bs->file. At this point, bs->file_child->bs just duplicates the bs->file pointer. Later, it will completely replace it. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia Reviewed-by: Fam

[Qemu-block] [PULL 17/29] block: Implement bdrv_append() without bdrv_swap()

2015-10-16 Thread Kevin Wolf
Remember all parent nodes and just change the pointers there instead of swapping the contents of the BlockDriverState. Handling of snapshot=on must be moved further down in bdrv_open() because *pbs (which is the bs pointer in the BlockBackend) must already be set before bdrv_append() is called.

[Qemu-block] [PULL 14/29] block/io: Make bdrv_requests_pending() public

2015-10-16 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi --- block/io.c| 2 +- include/block/block_int.h | 1 +

[Qemu-block] [PULL 10/29] block: Remove bdrv_open_image()

2015-10-16 Thread Kevin Wolf
It is unused now. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia Reviewed-by: Fam Zheng Reviewed-by: Jeff Cody Reviewed-by: Stefan Hajnoczi ---

[Qemu-block] [PULL 07/29] blkverify: Convert s->test_file to BdrvChild

2015-10-16 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia Reviewed-by: Fam Zheng Reviewed-by: Jeff Cody Reviewed-by: Stefan Hajnoczi --- block/blkverify.c | 41

[Qemu-block] [PULL 06/29] vmdk: Use BdrvChild instead of BDS for references to extents

2015-10-16 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia Reviewed-by: Fam Zheng Reviewed-by: Jeff Cody Reviewed-by: Stefan Hajnoczi --- block/vmdk.c | 99

[Qemu-block] [PULL 23/29] util - add automated ID generation utility

2015-10-16 Thread Kevin Wolf
From: Jeff Cody Multiple sub-systems in QEMU may find it useful to generate IDs for objects that a user may reference via QMP or HMP. This patch presents a standardized way to do it, so that automatic ID generation follows the same rules. This patch enforces the following

[Qemu-block] [PULL 22/29] blkverify: Fix BDS leak in .bdrv_open error path

2015-10-16 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Jeff Cody --- block/blkverify.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/blkverify.c b/block/blkverify.c index f8655ad..c5f8e8d 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -143,6 +143,9

[Qemu-block] [PULL 24/29] block: auto-generated node-names

2015-10-16 Thread Kevin Wolf
From: Jeff Cody If a node-name is not specified, automatically generate the node-name. Generated node-names will use the "block" sub-system identifier. Signed-off-by: Jeff Cody Signed-off-by: Kevin Wolf --- block.c

[Qemu-block] [PULL 12/29] block: Manage backing file references in bdrv_set_backing_hd()

2015-10-16 Thread Kevin Wolf
This simplifies the code somewhat, especially when dropping whole backing file subchains. The exception is the mirroring code that does adventurous things with bdrv_swap() and in order to keep it working, I had to duplicate most of bdrv_set_backing_hd() locally. We'll get rid again of this

[Qemu-block] [PULL 18/29] blockjob: Store device name at job creation

2015-10-16 Thread Kevin Wolf
Some block jobs change the block device graph on completion. This means that the device that owns the job and originally was addressed with its device name may no longer be what the corresponding BlockBackend points to. Previously, the effects of bdrv_swap() ensured that the job was (at least

[Qemu-block] [PULL 21/29] block: Allow bdrv_unref_child(bs, NULL)

2015-10-16 Thread Kevin Wolf
bdrv_unref() can be called with a NULL argument and doesn't do anything then. Make bdrv_unref_child() consistent with it. Signed-off-by: Kevin Wolf Reviewed-by: Jeff Cody --- block.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git

[Qemu-block] [PULL 25/29] raw-posix: warn about BDRV_O_NATIVE_AIO if libaio is unavailable

2015-10-16 Thread Kevin Wolf
From: Stefan Hajnoczi raw-posix.c silently ignores BDRV_O_NATIVE_AIO if libaio is unavailable. It is confusing when aio=native performance is identical to aio=threads because the binary was accidentally built without libaio. Print a deprecation warning if -drive aio=native

[Qemu-block] [PULL 26/29] blockdev: always compile in -drive aio= parsing

2015-10-16 Thread Kevin Wolf
From: Stefan Hajnoczi CONFIG_LINUX_AIO is an implementation detail of raw-posix.c. Don't mention CONFIG_LINUX_AIO in blockdev.c. Let block drivers decide what to do with BDRV_O_NATIVE_AIO. They may print an error if it is unsupported. Signed-off-by: Stefan Hajnoczi

[Qemu-block] [PULL 01/29] iotests: disable core dumps in test 061

2015-10-16 Thread Kevin Wolf
From: Alberto Garcia Commit 934659c460 disabled the supression of segmentation faults in bash tests. The new output of test 061, however, assumes that a core dump will be produced if a program aborts. This is not necessarily the case because core dumps can be disabled using

[Qemu-block] [PULL 03/29] qmp-commands.hx: Update the supported 'transaction' operations

2015-10-16 Thread Kevin Wolf
From: Kashyap Chamarthy Although the canonical source of reference for QMP commands is qapi-schema.json, for consistency's sake, update qmp-commands.hx to state the list of supported transactionable operations, namely: drive-backup blockdev-backup

[Qemu-block] [PULL 04/29] block: qemu-iotests - fix vmdk test 059.out

2015-10-16 Thread Kevin Wolf
From: Jeff Cody In commit fe646693acc13ac48b98435d14149ab04dc597bc, the option printout format changed. This updates the VMDK test 059.out to the correct output. Signed-off-by: Jeff Cody Reviewed-by: Fam Zheng Signed-off-by: Kevin Wolf

[Qemu-block] [PULL 00/29] Block layer patches

2015-10-16 Thread Kevin Wolf
The following changes since commit c49d3411faae8ffaab8f7e5db47405a008411c10: Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2015-10-12' into staging (2015-10-13 10:42:06 +0100) are available in the git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for you

[Qemu-block] [PULL 09/29] block: Convert bs->file to BdrvChild

2015-10-16 Thread Kevin Wolf
This patch removes the temporary duplication between bs->file and bs->file_child by converting everything to BdrvChild. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia Reviewed-by: Fam Zheng

[Qemu-block] [PULL 11/29] block: Convert bs->backing_hd to BdrvChild

2015-10-16 Thread Kevin Wolf
This is the final step in converting all of the BlockDriverState pointers that block drivers use to BdrvChild. After this patch, bs->children contains the full list of child nodes that are referenced by a given BDS, and these children are only referenced through BdrvChild, so that updating the

[Qemu-block] [PULL 15/29] block-backend: Add blk_set_bs()

2015-10-16 Thread Kevin Wolf
It allows changing the BlockDriverState that a BlockBackend points to. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi

[Qemu-block] [PULL 27/29] qemu-nbd: always compile in --aio=MODE option

2015-10-16 Thread Kevin Wolf
From: Stefan Hajnoczi The --aio=MODE option enables Linux AIO or Windows overlapped I/O. The #ifdef CONFIG_LINUX_AIO was a layering violation that also prevented Windows overlapped I/O from being used. Now that raw-posix.c prints an error when Linux AIO has not been

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Paul Durrant
> -Original Message- > From: Kevin Wolf [mailto:kw...@redhat.com] > Sent: 16 October 2015 16:02 > To: Paul Durrant > Cc: Fabio Fantoni; Stefano Stabellini; John Snow; Anthony Perard; qemu- > de...@nongnu.org; xen-de...@lists.xen.org; qemu-block@nongnu.org > Subject: Re: [Qemu-devel]

[Qemu-block] [PULL 29/29] blkdebug: Don't confuse image as backing file

2015-10-16 Thread Kevin Wolf
From: Fam Zheng The word "backing file" nowadays refers to the backing_hd in the external snapshot sense (i.e. bs->backing_hd), instead of the file sense (bs->file). Correct the comment to use the right term. Signed-off-by: Fam Zheng Reviewed-by: Alberto

[Qemu-block] [PULL 19/29] block: Add and use bdrv_replace_in_backing_chain()

2015-10-16 Thread Kevin Wolf
This cleans up the mess we left behind in the mirror code after the previous patch. Instead of using bdrv_swap(), just change pointers. The interface change of the mirror job that callers must consider is that after job completion, their local BDS pointers still point to the same node now.

[Qemu-block] [PULL 20/29] block: Remove bdrv_swap()

2015-10-16 Thread Kevin Wolf
bdrv_swap() is unused now. Remove it and all functions that have no other users than bdrv_swap(). In particular, this removes the .bdrv_rebind callbacks from block drivers. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia

[Qemu-block] [PULL 28/29] qcow2: Remove forward declaration of QCowAIOCB

2015-10-16 Thread Kevin Wolf
This struct doesn't exist any more since commit 3fc48d09 in August 2011, it's about time to remove its forward declaration. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- block/qcow2.h | 2 -- 1 file changed, 2 deletions(-) diff --git

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Kevin Wolf
Am 16.10.2015 um 16:24 hat Paul Durrant geschrieben: > > -Original Message- > > From: Kevin Wolf [mailto:kw...@redhat.com] > > Sent: 16 October 2015 15:04 > > To: Paul Durrant > > Cc: Fabio Fantoni; Stefano Stabellini; John Snow; Anthony Perard; qemu- > > de...@nongnu.org;

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Paul Durrant
> -Original Message- > From: Kevin Wolf [mailto:kw...@redhat.com] > Sent: 16 October 2015 15:04 > To: Paul Durrant > Cc: Fabio Fantoni; Stefano Stabellini; John Snow; Anthony Perard; qemu- > de...@nongnu.org; xen-de...@lists.xen.org; qemu-block@nongnu.org > Subject: Re: [Qemu-devel]

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Kevin Wolf
Am 16.10.2015 um 17:10 hat Paul Durrant geschrieben: > > -Original Message- > > From: Kevin Wolf [mailto:kw...@redhat.com] > > Sent: 16 October 2015 16:02 > > To: Paul Durrant > > Cc: Fabio Fantoni; Stefano Stabellini; John Snow; Anthony Perard; qemu- > > de...@nongnu.org;

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Paul Durrant
> -Original Message- > From: Kevin Wolf [mailto:kw...@redhat.com] > Sent: 16 October 2015 17:12 > To: Paul Durrant > Cc: Fabio Fantoni; Stefano Stabellini; John Snow; Anthony Perard; qemu- > de...@nongnu.org; xen-de...@lists.xen.org; qemu-block@nongnu.org > Subject: Re: [Qemu-devel]

Re: [Qemu-block] [Qemu-devel] [RFC] transactions: add transaction-wide property

2015-10-16 Thread John Snow
On 10/16/2015 08:23 AM, Stefan Hajnoczi wrote: > On Mon, Oct 12, 2015 at 12:50:20PM -0400, John Snow wrote: >> Ping -- any consensus on how we should implement the "do-or-die" >> argument for transactions that start block jobs? :) >> >> This patch may look a little hokey in how it boxes

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Kevin Wolf
Am 16.10.2015 um 18:20 hat Paul Durrant geschrieben: > > -Original Message- > > From: Kevin Wolf [mailto:kw...@redhat.com] > > Sent: 16 October 2015 17:12 > > To: Paul Durrant > > Cc: Fabio Fantoni; Stefano Stabellini; John Snow; Anthony Perard; qemu- > > de...@nongnu.org;

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Paul Durrant
> -Original Message- > From: Kevin Wolf [mailto:kw...@redhat.com] > Sent: 16 October 2015 17:43 > To: Paul Durrant > Cc: Fabio Fantoni; Stefano Stabellini; John Snow; Anthony Perard; qemu- > de...@nongnu.org; xen-de...@lists.xen.org; qemu-block@nongnu.org > Subject: Re: [Qemu-devel]