[Qemu-block] [PATCH 1/3] block-backend: Introduce blk_drain()

2015-06-10 Thread Alexander Yarygin
This patch introduces the blk_drain() function which allows to replace blk_drain_all() when only one BlockDriverState needs to be drained. Cc: Christian Borntraeger borntrae...@de.ibm.com Cc: Cornelia Huck cornelia.h...@de.ibm.com Cc: Kevin Wolf kw...@redhat.com Cc: Paolo Bonzini

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] block-backend: Introduce blk_drain() and replace blk_drain_all()

2015-06-10 Thread Fam Zheng
On Wed, 06/03 16:46, Alexander Yarygin wrote: Each call of the virtio_blk_reset() function calls blk_drain_all(), which works for all existing BlockDriverStates, while only one BlockDriverState needs to be drained. This patch introduces the blk_drain() function and replaces blk_drain_all()

[Qemu-block] [PATCH 9/9] slirp: Remove unused pollfds from the parameter list

2015-06-10 Thread Fam Zheng
Signed-off-by: Fam Zheng f...@redhat.com --- main-loop.c | 4 ++-- slirp/libslirp.h | 4 ++-- slirp/slirp.c| 4 ++-- stubs/slirp.c| 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/main-loop.c b/main-loop.c index 18b7508..b3808ae 100644 --- a/main-loop.c +++

Re: [Qemu-block] [Qemu-devel] [PATCH] block: allow write-threshold on device name

2015-06-10 Thread Eric Blake
On 06/10/2015 01:57 AM, Kevin Wolf wrote: The statistic I'm interested in is the allocation of the block device (the host offset, aka wr_highest_offset 72482304 above), and NOT the usage pattern of the guest (the qcow2 protocol, wr_highest_offset 9129332224). But bdrv_lookup_bs() finds the

Re: [Qemu-block] [Qemu-devel] [PATCH] block: allow write-threshold on device name

2015-06-10 Thread Kevin Wolf
Am 10.06.2015 um 00:35 hat Eric Blake geschrieben: On 06/06/2015 07:38 PM, Eric Blake wrote: Commit e2462113 allowed the ability to fire an event if a BDS node exceeds a threshold during a write, but limited the option to only work on node names. For convenience, expand this to allow a

[Qemu-block] [PATCH 5/9] slirp: Add poll_events to struct socket

2015-06-10 Thread Fam Zheng
The field stores the current interesting events. Signed-off-by: Fam Zheng f...@redhat.com --- slirp/socket.h | 1 + 1 file changed, 1 insertion(+) diff --git a/slirp/socket.h b/slirp/socket.h index 57e0407..0c49770 100644 --- a/slirp/socket.h +++ b/slirp/socket.h @@ -53,6 +53,7 @@ struct socket

Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/2] block: driver should override flags in bdrv_open()

2015-06-10 Thread Kevin Wolf
Am 09.06.2015 um 17:21 hat Eric Blake geschrieben: On 06/09/2015 08:48 AM, Stefan Hajnoczi wrote: I guess my @redhat.com email was received directly from Max because I was in CC list. It didn't pass through Mailman. I saw the original, unmodified list of CCs with Kevin included. The

[Qemu-block] [PATCH 6/9] slirp: Move icmp socket to iohandler

2015-06-10 Thread Fam Zheng
Where the fd was added, compare the events with so-poll_events and call qemu_set_fd_handler() to update if it's changed. Where the fd was not added, call qemu_set_fd_handler() to remove it. Update slirp-do_slowtimo with a return value. For simplicity, G_IO_HUP and G_IO_ERR are unnecessary to be

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/3] block: Extrace bdrv_parse_detect_zeroes_flags

2015-06-10 Thread Fam Zheng
On Wed, 06/10 17:11, Fam Zheng wrote: On Mon, 06/08 16:53, Paolo Bonzini wrote: On 08/06/2015 16:17, Eric Blake wrote: + +if (detect_zeroes == BLOCKDEV_DETECT_ZEROES_OPTIONS_UNMAP +!(bdrv_flags BDRV_O_UNMAP)) { +error_setg(errp, setting detect-zeroes

Re: [Qemu-block] [Qemu-devel] [PATCH] block: record new size in bdrv_dirty_bitmap_truncate

2015-06-10 Thread Kevin Wolf
Am 09.06.2015 um 17:46 hat John Snow geschrieben: On 06/09/2015 05:24 AM, Kevin Wolf wrote: Am 08.06.2015 um 22:49 hat John Snow geschrieben: ce1ffea8 neglected to update the BdrvDirtyBitmap structure itself for internal consistency. It's currently not an issue, but for migration and

[Qemu-block] [PATCH 3/9] main-loop: Move include of qemu/sockets.h to libslirp.h

2015-06-10 Thread Fam Zheng
Signed-off-by: Fam Zheng f...@redhat.com --- main-loop.c | 1 - slirp/libslirp.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/main-loop.c b/main-loop.c index 631caa0..18b7508 100644 --- a/main-loop.c +++ b/main-loop.c @@ -24,7 +24,6 @@ #include qemu-common.h

[Qemu-block] [PATCH 4/9] slirp: Remove dead code for PROBE_CONN

2015-06-10 Thread Fam Zheng
It has always been compiled out. Remove it before we refactor the rest part of slirp poll. Signed-off-by: Fam Zheng f...@redhat.com --- slirp/slirp.c| 40 slirp/slirp_config.h | 4 2 files changed, 44 deletions(-) diff --git a/slirp/slirp.c

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/3] block: Extrace bdrv_parse_detect_zeroes_flags

2015-06-10 Thread Fam Zheng
On Mon, 06/08 16:53, Paolo Bonzini wrote: On 08/06/2015 16:17, Eric Blake wrote: + +if (detect_zeroes == BLOCKDEV_DETECT_ZEROES_OPTIONS_UNMAP +!(bdrv_flags BDRV_O_UNMAP)) { +error_setg(errp, setting detect-zeroes to unmap is not allowed +

[Qemu-block] [PATCH v2 03/13] check-qdict: Test cases for new functions

2015-06-10 Thread Kevin Wolf
This adds test cases for the following new QDict functions: * qdict_array_entries() * qdict_set_default_str() * qdict_copy_default() Signed-off-by: Kevin Wolf kw...@redhat.com --- tests/check-qdict.c | 67 + 1 file changed, 67 insertions(+)

[Qemu-block] [PATCH v2 01/13] qdict: Add qdict_array_entries()

2015-06-10 Thread Kevin Wolf
This counts the entries in a flattened array in a QDict without actually splitting the QDict into a QList. bdrv_open_image() doesn't take a QList, but rather a QDict and a key prefix string, so this is more convenient for block drivers which have a dynamically sized list of child nodes (e.g.

[Qemu-block] [PATCH v2 04/13] quorum: Use bdrv_open_image()

2015-06-10 Thread Kevin Wolf
Besides standardising on a single interface for opening child nodes, this simplifies the .bdrv_open() implementation of the quorum block driver by using block layer functionality for handling BlockdevRefs. Signed-off-by: Kevin Wolf kw...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com

[Qemu-block] [PATCH v2 07/13] block: Use QemuOpts in bdrv_open_common()

2015-06-10 Thread Kevin Wolf
Instead of manually parsing options and then deleting them from the options QDict, just use QemuOpts like most other places that deal with block device options. More options will be added there and then QemuOpts is a lot more managable than open-coding everything. Signed-off-by: Kevin Wolf

Re: [Qemu-block] [Qemu-devel] [PATCH] block: allow write-threshold on device name

2015-06-10 Thread Kevin Wolf
Am 10.06.2015 um 15:07 hat Eric Blake geschrieben: On 06/10/2015 01:57 AM, Kevin Wolf wrote: The statistic I'm interested in is the allocation of the block device (the host offset, aka wr_highest_offset 72482304 above), and NOT the usage pattern of the guest (the qcow2 protocol,

[Qemu-block] [PATCH v2 09/13] block: Drain requests before swapping nodes in bdrv_swap()

2015-06-10 Thread Kevin Wolf
bdrv_swap() requires that there are no requests in flight on either of the two devices. The request coroutine would work on the wrong BlockDriverState object (with bs-opaque even being interpreted as a different type potentially) and all sorts of bad things would result from this. The currently

[Qemu-block] [PATCH v2 10/13] queue.h: Add QLIST_FIX_HEAD_PTR()

2015-06-10 Thread Kevin Wolf
If the head of a list has been moved to a different memory location, the le_prev link in the first list entry has to be fixed up. Provide a macro that implements this fixup. Signed-off-by: Kevin Wolf kw...@redhat.com --- include/qemu/queue.h | 6 ++ 1 file changed, 6 insertions(+) diff

[Qemu-block] [PATCH v2 06/13] block: Use macro for cache option names

2015-06-10 Thread Kevin Wolf
Signed-off-by: Kevin Wolf kw...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com Reviewed-by: Max Reitz mre...@redhat.com Reviewed-by: Jeff Cody jc...@redhat.com Reviewed-by: Alberto Garcia be...@igalia.com --- blockdev.c| 24 include/block/block.h | 8

[Qemu-block] [PATCH v2 12/13] block: Add BlockDriverState.inherits_from

2015-06-10 Thread Kevin Wolf
Currently, the block layer assumes that any block node can have only one parent, and if it has a parent, that it inherits some options/flags from this parent. This is not true any more: With references used in block device creation, a single node can be used by multiple parents, or it can be

[Qemu-block] [PATCH v2 11/13] block: Add list of children to BlockDriverState

2015-06-10 Thread Kevin Wolf
This allows iterating over all children of a given BDS, not only including bs-file and bs-backing_hd, but also driver-specific ones like VMDK extents or Quorum children. For bdrv_swap(), the list of children of the swapped BDS stays at that BDS (because that's where the pointers stay as well).

Re: [Qemu-block] [Qemu-devel] [PATCH] block: allow write-threshold on device name

2015-06-10 Thread Eric Blake
On 06/10/2015 07:43 AM, Kevin Wolf wrote: Let's stay away from such magic, as much as we can. libvirt can just specify a node-name for the protocol layer and use that. Okay, I'll probably abandon this patch, then, but still work on something to make node names easier for libvirt to

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] qapi: Add detect-zeroes option to drive-mirror

2015-06-10 Thread Andrey Korolyov
'{execute:drive-mirror, arguments: { device: drive-virtio-disk0, target: rbd:dev-rack2/vm33090-dest:id=qemukvm:key=xxx:auth_supported=cephx\\;none:mon_host=10.6.0.1\\:6789\\;10.6.0.3\\:6789\\;10.6.0.4\\:6789, mode: existing, sync: full, detect-zeroes: true, format: raw } }' Sorry, forgot to

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] qapi: Add detect-zeroes option to drive-mirror

2015-06-10 Thread Alexandre DERUMIER
Sorry, forgot to mention - of course I`ve pulled all previous zeroing-related queue, so I haven`t had only the QMP-related fix running on top of the master :) Hi, I had a discussion about rbd mirroring, detect-zeroes and sparse target, some months ago with paolo

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] qapi: Add detect-zeroes option to drive-mirror

2015-06-10 Thread Andrey Korolyov
On Mon, Jun 8, 2015 at 10:06 AM, Fam Zheng f...@redhat.com wrote: The new optional flag defaults to true, in which case, mirror job would check the read sectors and use sparse write if they are zero. Otherwise data will be fully copied. Signed-off-by: Fam Zheng f...@redhat.com ---

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] qapi: Add detect-zeroes option to drive-mirror

2015-06-10 Thread Andrey Korolyov
On Wed, Jun 10, 2015 at 7:04 PM, Alexandre DERUMIER aderum...@odiso.com wrote: Sorry, forgot to mention - of course I`ve pulled all previous zeroing-related queue, so I haven`t had only the QMP-related fix running on top of the master :) Hi, I had a discussion about rbd mirroring, detect-zeroes

Re: [Qemu-block] [PATCH v2 01/13] qdict: Add qdict_array_entries()

2015-06-10 Thread Eric Blake
On 06/10/2015 07:46 AM, Kevin Wolf wrote: This counts the entries in a flattened array in a QDict without actually splitting the QDict into a QList. bdrv_open_image() doesn't take a QList, but rather a QDict and a key prefix string, so this is more convenient for block drivers which have a

Re: [Qemu-block] [Qemu-devel] [PATCH] block: Change bitmap truncate conditional to assertion

2015-06-10 Thread Eric Blake
On 06/10/2015 11:24 AM, John Snow wrote: Requires: 1433796555-5608-1-git-send-email-js...@redhat.com [PATCH] block: record new size in bdrv_dirty_bitmap_truncate Shouldn't this be after the '---' separator? This is an artifact of an older version that had both all-bitmap and

Re: [Qemu-block] [Qemu-devel] [PATCH] block: Change bitmap truncate conditional to assertion

2015-06-10 Thread John Snow
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 06/10/2015 04:52 PM, Eric Blake wrote: On 06/10/2015 11:24 AM, John Snow wrote: Requires: 1433796555-5608-1-git-send-email-js...@redhat.com [PATCH] block: record new size in bdrv_dirty_bitmap_truncate Shouldn't this be after the '---'

Re: [Qemu-block] [PATCH RFC v2 0/3] Fix slow startup with many disks

2015-06-10 Thread Christian Borntraeger
Am 10.06.2015 um 13:38 schrieb Alexander Yarygin: Changes in v2: - Patch block-backend: Introduce blk_drain() and replace blk_drain_all() splitted to two. - blk_drain() moved to above virtio_blk_data_plane_stop(). During reset the aio_poll() function is called at least

[Qemu-block] [PATCH] block: Change bitmap truncate conditional to assertion

2015-06-10 Thread John Snow
Requires: 1433796555-5608-1-git-send-email-js...@redhat.com [PATCH] block: record new size in bdrv_dirty_bitmap_truncate This is an artifact of an older version that had both all-bitmap and single-bitmap truncate functions, and some info got lost in the shuffle. Bitmaps can only be

Re: [Qemu-block] [PATCH v2 07/13] block: Use QemuOpts in bdrv_open_common()

2015-06-10 Thread Eric Blake
On 06/10/2015 07:47 AM, Kevin Wolf wrote: Instead of manually parsing options and then deleting them from the options QDict, just use QemuOpts like most other places that deal with block device options. More options will be added there and then QemuOpts is a lot more managable than

Re: [Qemu-block] [PATCH v2 03/13] check-qdict: Test cases for new functions

2015-06-10 Thread Eric Blake
On 06/10/2015 07:46 AM, Kevin Wolf wrote: This adds test cases for the following new QDict functions: * qdict_array_entries() * qdict_set_default_str() * qdict_copy_default() Signed-off-by: Kevin Wolf kw...@redhat.com --- tests/check-qdict.c | 67

Re: [Qemu-block] [PATCH v2 02/13] qdict: Add qdict_{set, copy}_default()

2015-06-10 Thread Eric Blake
On 06/10/2015 07:46 AM, Kevin Wolf wrote: In the block layer functions that determine options for a child block device, it's a common pattern to either copy options from the parent's options or to set a default string if the option isn't explicitly set yet for the child. Provide convenience

Re: [Qemu-block] [PATCH v2 11/13] block: Add list of children to BlockDriverState

2015-06-10 Thread Eric Blake
On 06/10/2015 07:47 AM, Kevin Wolf wrote: This allows iterating over all children of a given BDS, not only including bs-file and bs-backing_hd, but also driver-specific ones like VMDK extents or Quorum children. For bdrv_swap(), the list of children of the swapped BDS stays at that BDS

Re: [Qemu-block] [PATCH v2 09/13] block: Drain requests before swapping nodes in bdrv_swap()

2015-06-10 Thread Eric Blake
On 06/10/2015 07:47 AM, Kevin Wolf wrote: bdrv_swap() requires that there are no requests in flight on either of the two devices. The request coroutine would work on the wrong BlockDriverState object (with bs-opaque even being interpreted as a different type potentially) and all sorts of bad

Re: [Qemu-block] [Qemu-devel] [PATCH 2/3] virtio-blk: Use blk_drain() to drain IO requests

2015-06-10 Thread Fam Zheng
On Wed, 06/10 14:38, Alexander Yarygin wrote: Each call of the virtio_blk_reset() function calls blk_drain_all(), which works for all existing BlockDriverStates, while draining only one is needed. This patch replaces blk_drain_all() by blk_drain() in virtio_blk_reset(). Please add a note

[Qemu-block] [PATCH 3/4] rbd: make qemu's cache setting override any ceph setting

2015-06-10 Thread Josh Durgin
To be safe, when cache=none is used ceph settings should not be able to override it to turn on caching. This was previously possible with rbd_cache=true in the rbd device configuration or a ceph configuration file. Similarly, rbd settings could have turned off caching when qemu requested it,

[Qemu-block] [PATCH 0/4] rbd cleanup and settings precedence fixes

2015-06-10 Thread Josh Durgin
Patches 1 and 2 are simple cleanups. 3 and 4 fix the precedence of cache options and ceph settings. The cache option precedence in particular is important due to the potential for misconfigurations (ceph.conf setting rbd_cache=true, qemu setting cache=none) to accidentally put data at risk. Josh

[Qemu-block] [PATCH 4/4] rbd: fix ceph settings precedence

2015-06-10 Thread Josh Durgin
Apply the ceph settings from a config file before any ceph settings from the command line. Since the ceph config file location may be specified on the command line, parse it once to read the config file, and do a second pass to apply the rest of the command line ceph options. Signed-off-by: Josh

[Qemu-block] [PATCH 2/4] MAINTAINERS: update email address

2015-06-10 Thread Josh Durgin
The old one still works for now, but will not work indefinitely. Signed-off-by: Josh Durgin jdur...@redhat.com --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 4ed8215..34eeb88 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@

[Qemu-block] [PATCH 1/4] rbd: remove unused constants and fields

2015-06-10 Thread Josh Durgin
RBDAIOCB.status was only used for cancel, which was removed in 7691e24dbebb46658e89b3f950fda6ec78bbb823. RBDAIOCB.sector_num was never used. RADOSCB.done and rcbid were never used. RBD_FD* are obsolete since the pipe was removed in e04fb07fd1676e9facd7f3f878c1bbe03bccd26b. Signed-off-by: Josh