[Qemu-block] [PATCH 0/2] nbd: add zero-init parameter

2016-10-05 Thread Denis V. Lunev
When using a nbd block device, the info about necessity of prior disk zeroing could significantly improve the speed of certain operations (e.g. backups). This patch also will allow to preserve QCOW2 images during migration. Management software now may specify zero-init option and thus abscent

[Qemu-block] [PATCH 1/2] nbd: change option parsing scheme

2016-10-05 Thread Denis V. Lunev
From: Denis Plotnikov This is a preparatory commit to make code more generic. We are going to add more options in the next patch. Signed-off-by: Denis Plotnikov Signed-off-by: Denis V. Lunev CC: Paolo Bonzini

Re: [Qemu-block] [PATCH 0/2] nbd: add zero-init parameter

2016-10-05 Thread Denis V. Lunev
On 10/05/2016 12:55 PM, Paolo Bonzini wrote: > > On 05/10/2016 11:33, Denis V. Lunev wrote: >> When using a nbd block device, the info about necessity of prior disk >> zeroing could significantly improve the speed of certain operations >> (e.g. backups). >> >> This patch also will allow to

[Qemu-block] [PATCH 1/3] block: Add node name to BLOCK_IO_ERROR event

2016-10-05 Thread Kevin Wolf
The event currently only contains the BlockBackend name. However, with anonymous BlockBackends, this is always the empty string. Add the node name so that the user can still see which block device caused the event. Signed-off-by: Kevin Wolf --- block/block-backend.c | 5 +++--

[Qemu-block] [PATCH 2/3] block-backend: Remember if attached device is non-qdev

2016-10-05 Thread Kevin Wolf
Almost all block devices are qdevified by now. This allows us to go back from the BlockBackend to the DeviceState. xen_disk is the last device that is missing. We'll remember in the BlockBackend if a xen_disk is attached and can then disable any features that require going from a BB to the

[Qemu-block] [PATCH 3/3] block: Add qdev ID to DEVICE_TRAY_MOVED

2016-10-05 Thread Kevin Wolf
The event currently only contains the BlockBackend name. However, with anonymous BlockBackends, this is always the empty string. Add the qdev ID (or if none was given, the QOM path) so that the user can still see which device caused the event. Event generation has to be moved from bdrv_eject() to

[Qemu-block] [PATCH v2 1/1] nbd: add zero-init parameter

2016-10-05 Thread Denis V. Lunev
When using a nbd block device, the info about necessity of prior disk zeroing could significantly improve the speed of certain operations (e.g. backups). This patch also will allow to preserve QCOW2 images during migration. Management software now may specify zero-init option and thus abscent

[Qemu-block] [PATCH 2/2] nbd: add zero-init parameter

2016-10-05 Thread Denis V. Lunev
From: Denis Plotnikov When using a nbd block device, the info about necessity of prior disk zeroing could significantly improve the speed of certain operations (e.g. backups). This patch also will allow to preserve QCOW2 images during migration. Management software now

Re: [Qemu-block] [PATCH] block: use bdrv_add_before_write_notifier

2016-10-05 Thread Kevin Wolf
Am 04.10.2016 um 10:49 hat Paolo Bonzini geschrieben: > Register the notifier using the specific API for block devices. > > Signed-off-by: Paolo Bonzini Thanks, applied to the block branch. Kevin

Re: [Qemu-block] [PATCH 0/2] nbd: add zero-init parameter

2016-10-05 Thread Paolo Bonzini
On 05/10/2016 11:33, Denis V. Lunev wrote: > When using a nbd block device, the info about necessity of prior disk > zeroing could significantly improve the speed of certain operations > (e.g. backups). > > This patch also will allow to preserve QCOW2 images during migration. > Management

[Qemu-block] [PATCH] Put the copyright information on a separate line

2016-10-05 Thread Thomas Huth
The output string QEMU with "--version" is very long, it does not fit into a normal line of a terminal window anymore. By putting the copyright information on a separate line instead, the output looks much nicer. Signed-off-by: Thomas Huth --- Note: I'm not sure whether there

[Qemu-block] [PATCH 0/3] block: Extend QMP events for anonymous BlockBackends

2016-10-05 Thread Kevin Wolf
We have two QMP events that include only a BlockBackend name and that are therefore useless with anonymous BBs. This series adds a node-name/qdev ID to them. Kevin Wolf (3): block: Add node name to BLOCK_IO_ERROR event block-backend: Remember if attached device is non-qdev block: Add qdev

Re: [Qemu-block] [PATCH] Put the copyright information on a separate line

2016-10-05 Thread Kevin Wolf
Am 05.10.2016 um 11:54 hat Thomas Huth geschrieben: > The output string QEMU with "--version" is very long, it does > not fit into a normal line of a terminal window anymore. By > putting the copyright information on a separate line instead, > the output looks much nicer. > > Signed-off-by:

Re: [Qemu-block] [PATCH v2 1/1] nbd: add zero-init parameter

2016-10-05 Thread Kevin Wolf
Am 05.10.2016 um 12:57 hat Denis V. Lunev geschrieben: > When using a nbd block device, the info about necessity of prior disk > zeroing could significantly improve the speed of certain operations > (e.g. backups). > > This patch also will allow to preserve QCOW2 images during migration. >

Re: [Qemu-block] [PATCH 1/2] nbd: change option parsing scheme

2016-10-05 Thread Paolo Bonzini
I reviewed this patch before noticing that the overall idea is not what Kevin suggested, so I'm sending it out anyway. Further comments from Kevin and Max might come since I am not familiar with the current conventions on parsing block device options. On 05/10/2016 11:33, Denis V. Lunev wrote: >

Re: [Qemu-block] [Qemu-devel] [PATCH] Put the copyright information on a separate line

2016-10-05 Thread Eric Blake
On 10/05/2016 04:54 AM, Thomas Huth wrote: > The output string QEMU with "--version" is very long, it does > not fit into a normal line of a terminal window anymore. By > putting the copyright information on a separate line instead, > the output looks much nicer. > > Signed-off-by: Thomas Huth

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/1] nbd: add zero-init parameter

2016-10-05 Thread Eric Blake
On 10/05/2016 05:57 AM, Denis V. Lunev wrote: > When using a nbd block device, the info about necessity of prior disk > zeroing could significantly improve the speed of certain operations > (e.g. backups). > > This patch also will allow to preserve QCOW2 images during migration. 'allow to' is

Re: [Qemu-block] [PATCH v2 02/11] blockjob: centralize QMP event emissions

2016-10-05 Thread Kevin Wolf
Am 01.10.2016 um 00:00 hat John Snow geschrieben: > There's no reason to leave this to blockdev; we can do it in blockjobs > directly and get rid of an extra callback for most users. > > Signed-off-by: John Snow > --- > blockdev.c | 37 ++--- >

Re: [Qemu-block] [PATCH v2 01/11] blockjob: fix dead pointer in txn list

2016-10-05 Thread Kevin Wolf
Am 01.10.2016 um 00:00 hat John Snow geschrieben: > From: Vladimir Sementsov-Ogievskiy > > Though it is not intended to be reached through normal circumstances, > if we do not gracefully deconstruct the transaction QLIST, we may wind > up with stale pointers in the

Re: [Qemu-block] [PATCH] block: use bdrv_add_before_write_notifier

2016-10-05 Thread Stefan Hajnoczi
On Tue, Oct 04, 2016 at 10:49:43AM +0200, Paolo Bonzini wrote: > Register the notifier using the specific API for block devices. > > Signed-off-by: Paolo Bonzini > --- > block/write-threshold.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) Reviewed-by: Stefan

Re: [Qemu-block] [Qemu-devel] backup notifier fail policy

2016-10-05 Thread Stefan Hajnoczi
On Wed, Oct 05, 2016 at 10:12:57AM +0200, Kevin Wolf wrote: > Am 04.10.2016 um 18:02 hat Stefan Hajnoczi geschrieben: > > On Tue, Oct 04, 2016 at 01:55:30PM +0200, Kevin Wolf wrote: > > > Am 04.10.2016 um 12:41 hat Denis V. Lunev geschrieben: > > > > On 10/04/2016 12:34 PM, Kevin Wolf wrote: > > >

Re: [Qemu-block] [PATCH v2 05/11] blockjobs: split interface into public/private

2016-10-05 Thread John Snow
On 10/05/2016 10:17 AM, Kevin Wolf wrote: Am 01.10.2016 um 00:00 hat John Snow geschrieben: To make it a little more obvious which functions are intended to be public interface and which are intended to be for use only by jobs themselves, split the interface into "public" and "private" files.

[Qemu-block] [PATCH 2/2] quorum: do not allocate multiple iovecs for FIFO strategy

2016-10-05 Thread Paolo Bonzini
In FIFO mode there are no parallel reads, hence there is no need to allocate separate buffers and clone the iovecs. The two cases of quorum_aio_cb are now even more different, and most of quorum_aio_finalize is only needed in one of them, so split them in separate functions. Signed-off-by: Paolo

[Qemu-block] [PATCH] blockjob: introduce .drain callback for jobs

2016-10-05 Thread Paolo Bonzini
This is required to decouple block jobs from running in an AioContext. With multiqueue block devices, a BlockDriverState does not really belong to a single AioContext. The solution is to first wait until all I/O operations are complete; then loop in the main thread for the block job to complete

[Qemu-block] [PATCH] block: change drain to look only at one child at a time

2016-10-05 Thread Paolo Bonzini
bdrv_requests_pending is checking children to also wait until internal requests (such as metadata writes) have completed. However, checking children is in general overkill. Children requests can be of two kinds: - requests caused by an operation on bs, e.g. a bdrv_aio_write to bs causing a

Re: [Qemu-block] [PATCH v9 09/10] tests: Add test code for hbitmap serialization

2016-10-05 Thread Max Reitz
On 05.10.2016 00:52, John Snow wrote: > From: Fam Zheng > > Signed-off-by: Fam Zheng > [Fixed minor constant issue. --js] > Signed-off-by: John Snow > > Signed-off-by: John Snow > --- > tests/test-hbitmap.c | 155 >

Re: [Qemu-block] [PATCH v2 06/11] blockjobs: fix documentation

2016-10-05 Thread John Snow
On 10/05/2016 11:03 AM, Kevin Wolf wrote: Am 01.10.2016 um 00:00 hat John Snow geschrieben: Wrong function names in documentation. Signed-off-by: John Snow --- include/block/blockjob_int.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

[Qemu-block] [PATCH 1/2] quorum: change child_iter to children_read

2016-10-05 Thread Paolo Bonzini
This simplifies a bit the code by using the usual C "inclusive start, exclusive end" pattern for ranges. Signed-off-by: Paolo Bonzini --- block/quorum.c | 30 +- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/block/quorum.c

[Qemu-block] [PATCH 0/2] quorum: cleanup and optimization for FIFO case

2016-10-05 Thread Paolo Bonzini
A couple patches I had lying in the huge multiqueue series but are not really related. So let's flush 'em... Paolo Bonzini (2): quorum: change child_iter to children_read quorum: do not allocate multiple iovecs for FIFO strategy block/quorum.c | 93

Re: [Qemu-block] [PATCH] block: change drain to look only at one child at a time

2016-10-05 Thread Paolo Bonzini
Please disregard this, I'll send it soon as part of the correct series. Paolo On 05/10/2016 18:47, Paolo Bonzini wrote: > bdrv_requests_pending is checking children to also wait until internal > requests (such as metadata writes) have completed. However, checking > children is in general

Re: [Qemu-block] [PATCH 1/2] quorum: change child_iter to children_read

2016-10-05 Thread Max Reitz
On 05.10.2016 18:35, Paolo Bonzini wrote: > This simplifies a bit the code by using the usual C "inclusive start, > exclusive end" pattern for ranges. > > Signed-off-by: Paolo Bonzini > --- > block/quorum.c | 30 +- > 1 file changed, 13

Re: [Qemu-block] [PATCH v2 04/11] blockjobs: Always use block_job_get_aio_context

2016-10-05 Thread Kevin Wolf
Am 01.10.2016 um 00:00 hat John Snow geschrieben: > There are a few places where we're fishing it out for ourselves. > Let's not do that and instead use the helper. > > Signed-off-by: John Snow That change makes a difference when the block job is running its completion part

Re: [Qemu-block] [PATCH] qcow2: Optimize L2 table cache size based on image and cluster sizes

2016-10-05 Thread Max Reitz
On 05.10.2016 16:57, Alberto Garcia wrote: > On Tue 04 Oct 2016 05:51:26 PM CEST, Max Reitz wrote: > >>> At least giving users a way to skip the math would be an improvement. >>> Would you be okay with an explicitly-set option like >>> l2_cache_size=auto or =max that optimizes for performance at

Re: [Qemu-block] [PATCH] qcow2: Optimize L2 table cache size based on image and cluster sizes

2016-10-05 Thread Kevin Wolf
Am 05.10.2016 um 17:13 hat Max Reitz geschrieben: > On 05.10.2016 16:57, Alberto Garcia wrote: > > On Tue 04 Oct 2016 05:51:26 PM CEST, Max Reitz wrote: > > > >>> At least giving users a way to skip the math would be an improvement. > >>> Would you be okay with an explicitly-set option like > >>>

Re: [Qemu-block] [PATCH] qcow2: Optimize L2 table cache size based on image and cluster sizes

2016-10-05 Thread Alberto Garcia
On Tue 04 Oct 2016 05:51:26 PM CEST, Max Reitz wrote: >> At least giving users a way to skip the math would be an improvement. >> Would you be okay with an explicitly-set option like >> l2_cache_size=auto or =max that optimizes for performance at the >> expense of memory? > > That

Re: [Qemu-block] [PATCH] qcow2: Optimize L2 table cache size based on image and cluster sizes

2016-10-05 Thread Alberto Garcia
On Wed 05 Oct 2016 05:13:39 PM CEST, Max Reitz wrote: At least giving users a way to skip the math would be an improvement. Would you be okay with an explicitly-set option like l2_cache_size=auto or =max that optimizes for performance at the expense of memory? >>> >> Frank

Re: [Qemu-block] [PATCH v2 06/11] blockjobs: fix documentation

2016-10-05 Thread Kevin Wolf
Am 01.10.2016 um 00:00 hat John Snow geschrieben: > Wrong function names in documentation. > > Signed-off-by: John Snow > --- > include/block/blockjob_int.h | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/include/block/blockjob_int.h

Re: [Qemu-block] [PATCH v2 09/11] blockjob: add block_job_start

2016-10-05 Thread Kevin Wolf
Am 01.10.2016 um 00:00 hat John Snow geschrieben: > Instead of automatically starting jobs at creation time via backup_start > et al, we'd like to return a job object pointer that can be started > manually at later point in time. > > For now, add the block_job_start mechanism and start the jobs >

Re: [Qemu-block] [PATCH 1/3] block: Add node name to BLOCK_IO_ERROR event

2016-10-05 Thread Max Reitz
On 05.10.2016 11:26, Kevin Wolf wrote: > The event currently only contains the BlockBackend name. However, with > anonymous BlockBackends, this is always the empty string. Add the node > name so that the user can still see which block device caused the event. > > Signed-off-by: Kevin Wolf

Re: [Qemu-block] [PATCH 3/3] block: Add qdev ID to DEVICE_TRAY_MOVED

2016-10-05 Thread Max Reitz
On 05.10.2016 11:26, Kevin Wolf wrote: > The event currently only contains the BlockBackend name. However, with > anonymous BlockBackends, this is always the empty string. Add the qdev > ID (or if none was given, the QOM path) so that the user can still see > which device caused the event. > >

Re: [Qemu-block] [PATCH 2/3] block-backend: Remember if attached device is non-qdev

2016-10-05 Thread Max Reitz
On 05.10.2016 11:26, Kevin Wolf wrote: > Almost all block devices are qdevified by now. This allows us to go back > from the BlockBackend to the DeviceState. xen_disk is the last device > that is missing. We'll remember in the BlockBackend if a xen_disk is > attached and can then disable any

Re: [Qemu-block] [PATCH 2/2] quorum: do not allocate multiple iovecs for FIFO strategy

2016-10-05 Thread Max Reitz
On 05.10.2016 18:35, Paolo Bonzini wrote: > In FIFO mode there are no parallel reads, hence there is no need to > allocate separate buffers and clone the iovecs. > > The two cases of quorum_aio_cb are now even more different, and > most of quorum_aio_finalize is only needed in one of them, so

Re: [Qemu-block] [PATCH 2/3] block-backend: Remember if attached device is non-qdev

2016-10-05 Thread Eric Blake
On 10/05/2016 01:01 PM, Max Reitz wrote: >> +static int blk_do_attach_dev(BlockBackend *blk, void *dev) >> + */ >> +int blk_attach_dev(BlockBackend *blk, DeviceState *dev) >> +{ >> +return blk_do_attach_dev(blk, dev); >> +void blk_attach_dev_legacy(BlockBackend *blk, void *dev) >> { >>

Re: [Qemu-block] [Qemu-devel] [PATCH v2 02/11] blockjob: centralize QMP event emissions

2016-10-05 Thread Eric Blake
On 10/05/2016 01:49 PM, John Snow wrote: >> Here we have an additional caller in block/replication.c and qemu-img, >> so the parameters must stay. For qemu-img, nothing changes. For >> replication, the block job events are added as a side effect. >> >> Not sure if we want to emit such events for

Re: [Qemu-block] [Qemu-devel] [PATCH v2 02/11] blockjob: centralize QMP event emissions

2016-10-05 Thread John Snow
On 10/05/2016 09:43 AM, Kevin Wolf wrote: Am 01.10.2016 um 00:00 hat John Snow geschrieben: There's no reason to leave this to blockdev; we can do it in blockjobs directly and get rid of an extra callback for most users. Signed-off-by: John Snow --- blockdev.c | 37

Re: [Qemu-block] [Qemu-devel] [PATCH v2 02/11] blockjob: centralize QMP event emissions

2016-10-05 Thread John Snow
On 10/05/2016 03:24 PM, Eric Blake wrote: On 10/05/2016 01:49 PM, John Snow wrote: Here we have an additional caller in block/replication.c and qemu-img, so the parameters must stay. For qemu-img, nothing changes. For replication, the block job events are added as a side effect. Not sure if