Re: [Qemu-block] [PATCH] mirror: fix the inconsistent AioContext problem in the backing BDSs during mirroring.

2017-06-28 Thread sochin.jiang
Oh,I got it, thanks. Sochin On 2017/6/29 6:33, Max Reitz wrote: > On 2017-06-26 13:04, sochin.jiang wrote: >> From: "sochin.jiang" >> >> mirror_complete opens the backings, BDSs of the new open backings should >> have a >> same AioContext with the top when using

Re: [Qemu-block] [PATCH v3 1/3] block: add bdrv_get_format_alloc_stat format interface

2017-06-28 Thread John Snow
On 06/28/2017 11:59 AM, Vladimir Sementsov-Ogievskiy wrote: > 27.06.2017 02:19, John Snow wrote: >> >> On 06/06/2017 12:26 PM, Vladimir Sementsov-Ogievskiy wrote: >>> The function should collect statistics, about used/unused by top-level >>> format driver space (in its .file) and allocation

Re: [Qemu-block] [PATCH v2 3/4] qcow2: add shrink image support

2017-06-28 Thread Max Reitz
On 2017-06-28 17:31, Pavel Butsykin wrote: > On 28.06.2017 16:59, Max Reitz wrote: >> On 2017-06-27 17:06, Pavel Butsykin wrote: >>> On 26.06.2017 20:47, Max Reitz wrote: On 2017-06-26 17:23, Pavel Butsykin wrote: >>> [] > > Is there any guarantee that in the future this will not

[Qemu-block] [PATCH] iotests: Add test for dataplane mirroring

2017-06-28 Thread Max Reitz
Signed-off-by: Max Reitz --- Depends on Stefan's "virtio: use ioeventfd in TCG and qtest mode" series to work at all, and on "mirror: Fix inconsistent backing AioContext for after mirroring" (in my block branch) so it does not fail. --- tests/qemu-iotests/106 | 97

Re: [Qemu-block] [Qemu-devel] [PATCH v4 1/2] live-block-ops.txt: Rename, rewrite, and improve it

2017-06-28 Thread Eric Blake
On 06/28/2017 03:15 PM, Alberto Garcia wrote: > On Wed 28 Jun 2017 04:58:00 PM CEST, Kashyap Chamarthy wrote: >> This patch documents (including their QMP invocations) all the four >> major kinds of live block operations: >> >> - `block-stream` >> - `block-commit` >> - `drive-mirror` (&

Re: [Qemu-block] [Qemu-devel] [PATCH 0/6] virtio: use ioeventfd in TCG and qtest mode

2017-06-28 Thread Eric Blake
On 06/28/2017 01:47 PM, Stefan Hajnoczi wrote: > This patch series fixes qemu-iotests 068. Since commit > ea4f3cebc4e0224605ab9dd9724aa4e7768fe372 ("qemu-iotests: 068: test iothread > mode") the test case has attempted to use dataplane without -M accel=kvm. > Although QEMU is capable of running

[Qemu-block] [PATCH 5/6] tests: fix virtio-net-test ISR dependence

2017-06-28 Thread Stefan Hajnoczi
Use the new used ring APIs instead of assuming ISR being set means the request has completed. Signed-off-by: Stefan Hajnoczi --- tests/virtio-net-test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/virtio-net-test.c

[Qemu-block] [PATCH 6/6] virtio-pci: use ioeventfd even when KVM is disabled

2017-06-28 Thread Stefan Hajnoczi
Old kvm.ko versions only supported a tiny number of ioeventfds so virtio-pci avoids ioeventfds when kvm_has_many_ioeventfds() returns 0. Do not check kvm_has_many_ioeventfds() when KVM is disabled since it always returns 0. Since commit 8c56c1a592b5092d91da8d8943c1d6462a6f ("memory: emulate

[Qemu-block] [PATCH 4/6] tests: fix virtio-blk-test ISR dependence

2017-06-28 Thread Stefan Hajnoczi
Use the new used ring APIs instead of assuming ISR being set means the request has completed. Signed-off-by: Stefan Hajnoczi --- tests/virtio-blk-test.c | 27 +-- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/tests/virtio-blk-test.c

[Qemu-block] [PATCH 3/6] tests: fix virtio-scsi-test ISR dependence

2017-06-28 Thread Stefan Hajnoczi
Use the new used ring APIs instead of assuming ISR being set means the request has completed. Signed-off-by: Stefan Hajnoczi --- tests/virtio-scsi-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/virtio-scsi-test.c b/tests/virtio-scsi-test.c

[Qemu-block] [PATCH 2/6] libqos: add virtio used ring support

2017-06-28 Thread Stefan Hajnoczi
Existing tests do not touch the virtqueue used ring. Instead they poll the virtqueue ISR register and peek into their request's device-specific status field. It turns out that the virtqueue ISR register can be set to 1 more than once for a single notification (see commit

[Qemu-block] [PATCH 0/6] virtio: use ioeventfd in TCG and qtest mode

2017-06-28 Thread Stefan Hajnoczi
This patch series fixes qemu-iotests 068. Since commit ea4f3cebc4e0224605ab9dd9724aa4e7768fe372 ("qemu-iotests: 068: test iothread mode") the test case has attempted to use dataplane without -M accel=kvm. Although QEMU is capable of running TCG or qtest with emulated ioeventfd/irqfd we haven't

[Qemu-block] [PATCH 1/6] libqos: fix typo in virtio.h QVirtQueue->used comment

2017-06-28 Thread Stefan Hajnoczi
Signed-off-by: Stefan Hajnoczi --- tests/libqos/virtio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/libqos/virtio.h b/tests/libqos/virtio.h index 3397a08..829de5e 100644 --- a/tests/libqos/virtio.h +++ b/tests/libqos/virtio.h @@ -26,7 +26,7 @@

[Qemu-block] [PATCH v3 10/11] dirty-bitmap: Switch bdrv_set_dirty() to bytes

2017-06-28 Thread Eric Blake
Both callers already had bytes available, but were scaling to sectors. Move the scaling to internal code. In the case of bdrv_aligned_pwritev(), we are now passing the exact offset rather than a rounded sector-aligned value, but that's okay as long as dirty bitmap widens start/bytes to

[Qemu-block] [PATCH v3 08/11] dirty-bitmap: Change bdrv_[re]set_dirty_bitmap() to use bytes

2017-06-28 Thread Eric Blake
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 to use byte rather than sectors for their

[Qemu-block] [PATCH v3 11/11] dirty-bitmap: Convert internal hbitmap size/granularity

2017-06-28 Thread Eric Blake
Now that all callers are using byte-based interfaces, there's no reason for our internal hbitmap to remain with sector-based granularity. It also simplifies our internal scaling, since we already know that hbitmap widens requests out to granularity boundaries. Signed-off-by: Eric Blake

[Qemu-block] [PATCH v3 06/11] dirty-bitmap: Change bdrv_get_dirty_count() to report bytes

2017-06-28 Thread Eric Blake
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 --- v3: no change, add R-b v2: no

[Qemu-block] [PATCH v3 07/11] dirty-bitmap: Change bdrv_get_dirty_locked() to take bytes

2017-06-28 Thread Eric Blake
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 future dirty-bitmap patch to offload scaling over

[Qemu-block] [PATCH v3 09/11] mirror: Switch mirror_dirty_init() to byte-based iteration

2017-06-28 Thread Eric Blake
Now that we have adjusted the majority of the calls this function makes to be byte-based, it is easier to read the code if it makes passes over the image using bytes rather than sectors. Signed-off-by: Eric Blake Reviewed-by: John Snow --- v2: no change ---

[Qemu-block] [PATCH v3 04/11] dirty-bitmap: Set iterator start by offset, not sector

2017-06-28 Thread Eric Blake
All callers to bdrv_dirty_iter_new() passed 0 for their initial starting point, drop that parameter. All callers to bdrv_set_dirty_iter() were scaling an offset to a sector number; move the scaling to occur internally to dirty bitmap code instead. Signed-off-by: Eric Blake

[Qemu-block] [PATCH v3 02/11] dirty-bitmap: Drop unused functions

2017-06-28 Thread Eric Blake
We had several functions that no one is currently using, and which use sector-based interfaces. I'm trying to convert towards byte-based interfaces, so it's easier to just drop the unused functions: bdrv_dirty_bitmap_size bdrv_dirty_bitmap_get_meta bdrv_dirty_bitmap_get_meta_locked

[Qemu-block] [PATCH v3 05/11] dirty-bitmap: Change bdrv_dirty_iter_next() to report byte offset

2017-06-28 Thread Eric Blake
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 --- v2: no change --- block/backup.c | 2 +- block/dirty-bitmap.c | 2 +-

[Qemu-block] [PATCH v3 03/11] dirty-bitmap: Track size in bytes

2017-06-28 Thread Eric Blake
We are still using an internal hbitmap that tracks a size in sectors, with the granularity scaled down accordingly, because it lets us use a shortcut for our iterators which are currently sector-based. But there's no reason we can't track the dirty bitmap size in bytes, since it is an

[Qemu-block] [PATCH v3 00/11] make dirty-bitmap byte-based

2017-06-28 Thread Eric Blake
There are patches floating around to add NBD_CMD_BLOCK_STATUS, but NBD wants to report status on byte granularity (even if the reporting will probably be naturally aligned to sectors or even much higher levels). I've therefore started the task of converting our block status code to report at a

[Qemu-block] [PATCH v3 01/11] dirty-bitmap: Report BlockDirtyInfo.count in bytes, as documented

2017-06-28 Thread Eric Blake
We've been documenting the value in bytes since its introduction in commit b9a9b3a4 (v1.3), where it was actually reported in bytes. Commit e4654d2 (v2.0) then removed things from block/qapi.c, in preparation for a rewrite to a list of dirty sectors in the next commit 21b5683 in block.c, but the

Re: [Qemu-block] [Qemu-devel] [PATCH RFC v3 5/8] block: add BlockDevOptionsThrottle to QAPI

2017-06-28 Thread Kevin Wolf
Am 28.06.2017 um 18:02 hat Eric Blake geschrieben: > On 06/28/2017 10:50 AM, Kevin Wolf wrote: > > Am 23.06.2017 um 14:46 hat Manos Pitsidianakis geschrieben: > >> This is needed to configure throttle filter driver nodes with QAPI. > >> > >> Signed-off-by: Manos Pitsidianakis

Re: [Qemu-block] [Qemu-devel] [RFC] QMP design: Fixing query-block and friends

2017-06-28 Thread John Snow
On 06/28/2017 03:15 AM, Markus Armbruster wrote: > John Snow writes: > >> On 06/27/2017 12:31 PM, Kevin Wolf wrote: >>> Hi, >>> >>> I haven't really liked query-block for a long time, but now that >>> blockdev-add and -blockdev have settled, it might finally be the time to

Re: [Qemu-block] [Qemu-devel] [PATCH RFC v3 5/8] block: add BlockDevOptionsThrottle to QAPI

2017-06-28 Thread Eric Blake
On 06/28/2017 10:50 AM, Kevin Wolf wrote: > Am 23.06.2017 um 14:46 hat Manos Pitsidianakis geschrieben: >> This is needed to configure throttle filter driver nodes with QAPI. >> >> Signed-off-by: Manos Pitsidianakis >> --- >> qapi/block-core.json | 19 ++- >>

Re: [Qemu-block] [PATCH v3 1/3] block: add bdrv_get_format_alloc_stat format interface

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
27.06.2017 02:19, John Snow wrote: On 06/06/2017 12:26 PM, Vladimir Sementsov-Ogievskiy wrote: The function should collect statistics, about used/unused by top-level format driver space (in its .file) and allocation status (data/zero/discarded/after-eof) of corresponding areas in this .file.

Re: [Qemu-block] [PATCH RFC v3 6/8] block: add options parameter to bdrv_new_open_driver()

2017-06-28 Thread Kevin Wolf
Am 26.06.2017 um 17:11 hat Stefan Hajnoczi geschrieben: > On Fri, Jun 23, 2017 at 03:46:58PM +0300, Manos Pitsidianakis wrote: > > diff --git a/block.c b/block.c > > index 694396281b..c7d9f8959a 100644 > > --- a/block.c > > +++ b/block.c > > @@ -1150,20 +1150,25 @@ free_and_fail: > > } > > > >

Re: [Qemu-block] [PATCH RFC v3 5/8] block: add BlockDevOptionsThrottle to QAPI

2017-06-28 Thread Kevin Wolf
Am 23.06.2017 um 14:46 hat Manos Pitsidianakis geschrieben: > This is needed to configure throttle filter driver nodes with QAPI. > > Signed-off-by: Manos Pitsidianakis > --- > qapi/block-core.json | 19 ++- > 1 file changed, 18 insertions(+), 1 deletion(-)

Re: [Qemu-block] [PATCH RFC v3 3/8] block: add throttle block filter driver

2017-06-28 Thread Manos Pitsidianakis
On Wed, Jun 28, 2017 at 05:36:54PM +0200, Kevin Wolf wrote: Am 28.06.2017 um 17:22 hat Manos Pitsidianakis geschrieben: Since we're moving groups to QOM we will need ids for each group. Can objects be anonymous? Hm, that's a good question. But object_new() doesn't take an ID, so I think they

Re: [Qemu-block] [PATCH] tests: Avoid non-portable 'echo -ARG'

2017-06-28 Thread Edgar E. Iglesias
On Wed, Jun 28, 2017 at 09:21:37AM -0500, Eric Blake wrote: > POSIX says that backslashes in the arguments to 'echo', as well as > any use of 'echo -n' and 'echo -e', are non-portable; it recommends > people should favor 'printf' instead. This is definitely true where > we do not control which

Re: [Qemu-block] [PATCH RFC v3 3/8] block: add throttle block filter driver

2017-06-28 Thread Kevin Wolf
Am 28.06.2017 um 17:22 hat Manos Pitsidianakis geschrieben: > On Wed, Jun 28, 2017 at 04:40:12PM +0200, Kevin Wolf wrote: > >Am 23.06.2017 um 14:46 hat Manos Pitsidianakis geschrieben: > >>block/throttle.c uses existing I/O throttle infrastructure inside a > >>block filter driver. I/O operations

Re: [Qemu-block] [PATCH v2 3/4] qcow2: add shrink image support

2017-06-28 Thread Pavel Butsykin
On 28.06.2017 16:59, Max Reitz wrote: On 2017-06-27 17:06, Pavel Butsykin wrote: On 26.06.2017 20:47, Max Reitz wrote: On 2017-06-26 17:23, Pavel Butsykin wrote: [] Is there any guarantee that in the future this will not change? Because in this case it can be a potential danger. Since

Re: [Qemu-block] [PATCH RFC v3 3/8] block: add throttle block filter driver

2017-06-28 Thread Manos Pitsidianakis
On Wed, Jun 28, 2017 at 04:40:12PM +0200, Kevin Wolf wrote: Am 23.06.2017 um 14:46 hat Manos Pitsidianakis geschrieben: block/throttle.c uses existing I/O throttle infrastructure inside a block filter driver. I/O operations are intercepted in the filter's read/write coroutines, and referred to

[Qemu-block] [PATCH v4 2/2] bitmaps.md: Convert to rST; move it into 'interop' dir

2017-06-28 Thread Kashyap Chamarthy
This is part of the on-going effort to convert QEMU upstream documentation syntax to reStructuredText (rST). The conversion to rST was done using: $ pandoc -f markdown -t rst bitmaps.md -o bitmaps.rst Then, make a couple of small syntactical adjustments. While at it, reword a statement to

[Qemu-block] [PATCH v4 1/2] live-block-ops.txt: Rename, rewrite, and improve it

2017-06-28 Thread Kashyap Chamarthy
This patch documents (including their QMP invocations) all the four major kinds of live block operations: - `block-stream` - `block-commit` - `drive-mirror` (& `blockdev-mirror`) - `drive-backup` (& `blockdev-backup`) Things considered while writing this document: - Use

[Qemu-block] [PATCH v4 0/2] Rewrite 'live-block-ops.txt'; convert 'bitmaps.md' to rST

2017-06-28 Thread Kashyap Chamarthy
Rewrite the 'live-block-ops.txt' document (after renaming it to 'live-block-operations.rst') in reStructuredText (rST) format. Given upstream QEMU's desire[*] to take advantage of the Sphinx + rST framework to gerate its documentation: "Based on experience from the Linux kernel, QEMU's docs

Re: [Qemu-block] [PATCH 1/4] block/qcow2: add compression_algorithm create option

2017-06-28 Thread Denis V. Lunev
On 06/27/2017 03:34 PM, Peter Lieven wrote: > this patch adds a new compression_algorithm option when creating qcow2 images. > The current default for the compresison algorithm is zlib and zlib will be > used when this option is omitted (like before). > > If the option is specified e.g. with: > >

[Qemu-block] [PATCH v4 0/2] Rewrite 'live-block-ops.txt'; convert 'bitmaps.md' to rST

2017-06-28 Thread Kashyap Chamarthy
Rewrite the 'live-block-ops.txt' document (after renaming it to 'live-block-operations.rst') in reStructuredText (rST) format. Given upstream QEMU's desire[*] to take advantage of the Sphinx + rST framework to gerate its documentation: "Based on experience from the Linux kernel, QEMU's docs

Re: [Qemu-block] [Qemu-devel] [PATCH 1/4] block/qcow2: add compression_algorithm create option

2017-06-28 Thread Denis V. Lunev
On 06/27/2017 04:27 PM, Peter Lieven wrote: > Am 27.06.2017 um 15:20 schrieb Daniel P. Berrange: >> On Tue, Jun 27, 2017 at 02:34:07PM +0200, Peter Lieven wrote: >>> this patch adds a new compression_algorithm option when creating >>> qcow2 images. >>> The current default for the compresison

Re: [Qemu-block] [PATCH RFC v3 3/8] block: add throttle block filter driver

2017-06-28 Thread Kevin Wolf
Am 23.06.2017 um 14:46 hat Manos Pitsidianakis geschrieben: > block/throttle.c uses existing I/O throttle infrastructure inside a > block filter driver. I/O operations are intercepted in the filter's > read/write coroutines, and referred to block/throttle-groups.c > > The driver can be used with

Re: [Qemu-block] [PATCH v22 13/30] block: new bdrv_reopen_bitmaps_rw interface

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
28.06.2017 16:31, Paolo Bonzini wrote: On 28/06/2017 15:02, Vladimir Sementsov-Ogievskiy wrote: It is interesting, but I see this problem only in your answers, in my letters I see this white-space on its place. That's the good old Thunderbird "format=flowed" bug. Vladimir, download

[Qemu-block] [PATCH] tests: Avoid non-portable 'echo -ARG'

2017-06-28 Thread Eric Blake
POSIX says that backslashes in the arguments to 'echo', as well as any use of 'echo -n' and 'echo -e', are non-portable; it recommends people should favor 'printf' instead. This is definitely true where we do not control which shell is running (such as in makefile snippets or in documentation

Re: [Qemu-block] [PATCH v2 3/4] qcow2: add shrink image support

2017-06-28 Thread Max Reitz
On 2017-06-27 17:06, Pavel Butsykin wrote: > On 26.06.2017 20:47, Max Reitz wrote: >> On 2017-06-26 17:23, Pavel Butsykin wrote: > [] >>> >>> Is there any guarantee that in the future this will not change? Because >>> in this case it can be a potential danger. >> >> Since this behavior is not

Re: [Qemu-block] [PATCH v22 00/30] qcow2: persistent dirty bitmaps

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
28.06.2017 16:01, Paolo Bonzini wrote: On 28/06/2017 14:05, Vladimir Sementsov-Ogievskiy wrote: Rebase on master, so changes, mostly related to new dirty bitmaps mutex: 10: - asserts now in bdrv_{re,}set_dirty_bitmap_locked functions. - also add assert into bdrv_undo_clear_dirty_bitmap

Re: [Qemu-block] [PATCH RFC v3 6/8] block: add options parameter to bdrv_new_open_driver()

2017-06-28 Thread Manos Pitsidianakis
On Wed, Jun 28, 2017 at 03:42:41PM +0200, Alberto Garcia wrote: On Fri 23 Jun 2017 02:46:58 PM CEST, Manos Pitsidianakis wrote: BlockDriverState *bdrv_new_open_driver(BlockDriver *drv, const char *node_name, - int flags, Error **errp) +

Re: [Qemu-block] [PATCH RFC v3 6/8] block: add options parameter to bdrv_new_open_driver()

2017-06-28 Thread Alberto Garcia
On Fri 23 Jun 2017 02:46:58 PM CEST, Manos Pitsidianakis wrote: > BlockDriverState *bdrv_new_open_driver(BlockDriver *drv, const char > *node_name, > - int flags, Error **errp) > + int flags, QDict *options, Error >

Re: [Qemu-block] [PATCH RFC v3 5/8] block: add BlockDevOptionsThrottle to QAPI

2017-06-28 Thread Manos Pitsidianakis
On Wed, Jun 28, 2017 at 03:35:48PM +0200, Alberto Garcia wrote: On Fri 23 Jun 2017 02:46:57 PM CEST, Manos Pitsidianakis wrote: +# @BlockdevOptionsThrottle: +# +# Driver specific block device options for Throttle +# I would put this earlier in the json file, together with the rest of the

Re: [Qemu-block] [PATCH RFC v3 5/8] block: add BlockDevOptionsThrottle to QAPI

2017-06-28 Thread Alberto Garcia
On Fri 23 Jun 2017 02:46:57 PM CEST, Manos Pitsidianakis wrote: > +# @BlockdevOptionsThrottle: > +# > +# Driver specific block device options for Throttle > +# I would put this earlier in the json file, together with the rest of the BlockdevOptions* structs. > +# @throttling-group: the name of

Re: [Qemu-block] [PATCH v22 13/30] block: new bdrv_reopen_bitmaps_rw interface

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
Finally, it looks like thunderbird bug https://bugzilla.mozilla.org/show_bug.cgi?id=1160880 [sorry for so much offtopic] 28.06.2017 16:13, Vladimir Sementsov-Ogievskiy wrote: 28.06.2017 16:02, Vladimir Sementsov-Ogievskiy wrote: It is interesting, but I see this problem only in your answers,

Re: [Qemu-block] [PATCH v22 13/30] block: new bdrv_reopen_bitmaps_rw interface

2017-06-28 Thread Paolo Bonzini
On 28/06/2017 15:02, Vladimir Sementsov-Ogievskiy wrote: > It is interesting, but I see this problem only in your answers, in my > letters I see this white-space on its place. That's the good old Thunderbird "format=flowed" bug. Vladimir, download

Re: [Qemu-block] [PATCH v22 13/30] block: new bdrv_reopen_bitmaps_rw interface

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
28.06.2017 16:02, Vladimir Sementsov-Ogievskiy wrote: It is interesting, but I see this problem only in your answers, in my letters I see this white-space on its place. In outgoing letter I see this white-space, but in letter from mailing-list it is absent. 28.06.2017 15:36, Eric Blake

Re: [Qemu-block] [Qemu-devel] [PULL 11/61] virtio-pci: use ioeventfd even when KVM is disabled

2017-06-28 Thread QingFeng Hao
在 2017/6/28 18:22, Kevin Wolf 写道: Am 28.06.2017 um 12:11 hat QingFeng Hao geschrieben: 在 2017/6/24 0:21, Kevin Wolf 写道: From: Stefan Hajnoczi Old kvm.ko versions only supported a tiny number of ioeventfds so virtio-pci avoids ioeventfds when kvm_has_many_ioeventfds()

Re: [Qemu-block] [PATCH v22 13/30] block: new bdrv_reopen_bitmaps_rw interface

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
It is interesting, but I see this problem only in your answers, in my letters I see this white-space on its place. 28.06.2017 15:36, Eric Blake wrote: [meta-comment] On 06/28/2017 07:10 AM, Vladimir Sementsov-Ogievskiy wrote: 28.06.2017 15:05, Vladimir Sementsov-Ogievskiy wrote: Add format

Re: [Qemu-block] [PATCH v22 00/30] qcow2: persistent dirty bitmaps

2017-06-28 Thread Paolo Bonzini
On 28/06/2017 14:05, Vladimir Sementsov-Ogievskiy wrote: > Rebase on master, so changes, mostly related to new dirty bitmaps mutex: > > 10: - asserts now in bdrv_{re,}set_dirty_bitmap_locked functions. > - also add assert into bdrv_undo_clear_dirty_bitmap (the only change, not > related to

Re: [Qemu-block] [Xen-devel] [PATCH v2 0/3] xen-disk: performance improvements

2017-06-28 Thread Paul Durrant
> -Original Message- > From: Stefano Stabellini [mailto:sstabell...@kernel.org] > Sent: 27 June 2017 23:07 > To: Paul Durrant > Cc: xen-de...@lists.xenproject.org; qemu-de...@nongnu.org; qemu- > bl...@nongnu.org > Subject: Re: [Xen-devel] [PATCH v2 0/3] xen-disk:

Re: [Qemu-block] [PATCH RFC v3 2/8] block: Add aio_context field in ThrottleGroupMember

2017-06-28 Thread Kevin Wolf
Am 28.06.2017 um 14:15 hat Manos Pitsidianakis geschrieben: > On Wed, Jun 28, 2017 at 01:27:36PM +0200, Kevin Wolf wrote: > >Am 23.06.2017 um 14:46 hat Manos Pitsidianakis geschrieben: > >>timer_cb() needs to know about the current Aio context of the throttle > >>request that is woken up. In order

Re: [Qemu-block] [PATCH v22 13/30] block: new bdrv_reopen_bitmaps_rw interface

2017-06-28 Thread Eric Blake
[meta-comment] On 06/28/2017 07:10 AM, Vladimir Sementsov-Ogievskiy wrote: > 28.06.2017 15:05, Vladimir Sementsov-Ogievskiy wrote: >> Add format driver handler, which should mark loaded read-only >> bitmaps as 'IN_USE' in the image and unset read_only field in >> corresponding BdrvDirtyBitmap's.

Re: [Qemu-block] [PATCH v22 13/30] block: new bdrv_reopen_bitmaps_rw interface

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
28.06.2017 15:05, Vladimir Sementsov-Ogievskiy wrote: Add format driver handler, which should mark loaded read-only bitmaps as 'IN_USE' in the image and unset read_only field in corresponding BdrvDirtyBitmap's. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by:

[Qemu-block] [PATCH v22 22/30] qcow2: add .bdrv_can_store_new_dirty_bitmap

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
Realize .bdrv_can_store_new_dirty_bitmap interface. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow Reviewed-by: Max Reitz --- block/qcow2-bitmap.c | 51 +++

[Qemu-block] [PATCH v22 00/30] qcow2: persistent dirty bitmaps

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
Hi all! There is a new update of qcow2-bitmap series - v22. web: https://src.openvz.org/users/vsementsov/repos/qemu/browse?at=qcow2-bitmap-v22 git: https://src.openvz.org/scm/~vsementsov/qemu.git (tag qcow2-bitmap-v22) v22: Rebase on master, so changes, mostly related to new dirty bitmaps

[Qemu-block] [PATCH v22 23/30] qmp: add persistent flag to block-dirty-bitmap-add

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
Add optional 'persistent' flag to qmp command block-dirty-bitmap-add. Default is false. Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Denis V. Lunev Reviewed-by: Max Reitz Reviewed-by: John Snow ---

[Qemu-block] [PATCH v22 13/30] block: new bdrv_reopen_bitmaps_rw interface

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
Add format driver handler, which should mark loaded read-only bitmaps as 'IN_USE' in the image and unset read_only field in corresponding BdrvDirtyBitmap's. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow --- block.c

[Qemu-block] [PATCH v22 14/30] qcow2: support .bdrv_reopen_bitmaps_rw

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
Realize bdrv_reopen_bitmaps_rw interface. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow Reviewed-by: Max Reitz --- block/qcow2-bitmap.c | 61 block/qcow2.c

[Qemu-block] [PATCH v22 10/30] block/dirty-bitmap: add readonly field to BdrvDirtyBitmap

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
It will be needed in following commits for persistent bitmaps. If bitmap is loaded from read-only storage (and we can't mark it "in use" in this storage) corresponding BdrvDirtyBitmap should be read-only. Signed-off-by: Vladimir Sementsov-Ogievskiy ---

[Qemu-block] [PATCH v22 01/30] specs/qcow2: fix bitmap granularity qemu-specific note

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow --- docs/interop/qcow2.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/interop/qcow2.txt b/docs/interop/qcow2.txt index 80cdfd0e91..dda53dd2a3 100644 ---

[Qemu-block] [PATCH v22 25/30] qmp: add x-debug-block-dirty-bitmap-sha256

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/dirty-bitmap.c | 5 + blockdev.c | 25 + include/block/dirty-bitmap.h | 1 + include/qemu/hbitmap.h | 8 qapi/block-core.json | 27

[Qemu-block] [PATCH v22 07/30] qcow2-refcount: rename inc_refcounts() and make it public

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
This is needed for the following patch, which will introduce refcounts checking for qcow2 bitmaps. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Reviewed-by: John Snow --- block/qcow2-refcount.c | 53

[Qemu-block] [PATCH v22 09/30] block/dirty-bitmap: fix comment for BlockDirtyBitmap.disabled field

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow Reviewed-by: Max Reitz --- block/dirty-bitmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c

[Qemu-block] [PATCH v22 20/30] qcow2: store bitmaps on reopening image as read-only

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
Store bitmaps and mark them read-only on reopening image as read-only. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/qcow2-bitmap.c | 22 ++ block/qcow2.c| 5 + block/qcow2.h|

[Qemu-block] [PATCH v22 08/30] qcow2: add bitmaps extension

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
Add bitmap extension as specified in docs/specs/qcow2.txt. For now, just mirror extension header into Qcow2 state and check constraints. Also, calculate refcounts for qcow2 bitmaps, to not break qemu-img check. For now, disable image resize if it has bitmaps. It will be fixed later.

[Qemu-block] [PATCH v22 17/30] block: introduce persistent dirty bitmaps

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
New field BdrvDirtyBitmap.persistent means, that bitmap should be saved by format driver in .bdrv_close and .bdrv_inactivate. No format driver supports it for now. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/dirty-bitmap.c | 29

[Qemu-block] [PATCH v22 15/30] block/dirty-bitmap: add autoload field to BdrvDirtyBitmap

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
Mirror AUTO flag from Qcow2 bitmap in BdrvDirtyBitmap. This will be needed in future, to save this flag back to Qcow2 for persistent bitmaps. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/dirty-bitmap.c | 18 ++ block/qcow2-bitmap.c

[Qemu-block] [PATCH v22 21/30] block: add bdrv_can_store_new_dirty_bitmap

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
This will be needed to check some restrictions before making bitmap persistent in qmp-block-dirty-bitmap-add (this functionality will be added by future patch) Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Reviewed-by: John Snow

Re: [Qemu-block] [PATCH RFC v3 3/8] block: add throttle block filter driver

2017-06-28 Thread Stefan Hajnoczi
On Tue, Jun 27, 2017 at 04:34:22PM +0300, Manos Pitsidianakis wrote: > On Tue, Jun 27, 2017 at 01:45:40PM +0100, Stefan Hajnoczi wrote: > > On Mon, Jun 26, 2017 at 07:26:41PM +0300, Manos Pitsidianakis wrote: > > > On Mon, Jun 26, 2017 at 03:30:55PM +0100, Stefan Hajnoczi wrote: > > > > > +

Re: [Qemu-block] [PATCH RFC v3 4/8] block: convert ThrottleGroup to object with QOM

2017-06-28 Thread Stefan Hajnoczi
On Tue, Jun 27, 2017 at 06:05:55PM +0200, Alberto Garcia wrote: > On Mon 26 Jun 2017 06:58:32 PM CEST, Manos Pitsidianakis wrote: > > On Mon, Jun 26, 2017 at 03:52:34PM +0100, Stefan Hajnoczi wrote: > >>On Fri, Jun 23, 2017 at 03:46:56PM +0300, Manos Pitsidianakis wrote: > >>> +static bool

[Qemu-block] [PATCH v22 19/30] qcow2: add persistent dirty bitmaps support

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
Store persistent dirty bitmaps in qcow2 image. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/qcow2-bitmap.c | 475 +++ block/qcow2.c| 9 + block/qcow2.h

[Qemu-block] [PATCH v22 18/30] block/dirty-bitmap: add bdrv_dirty_bitmap_next()

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Reviewed-by: John Snow --- block/dirty-bitmap.c | 7 +++ include/block/dirty-bitmap.h | 2 ++ 2 files changed, 9 insertions(+) diff --git

[Qemu-block] [PATCH v22 27/30] block/dirty-bitmap: add bdrv_remove_persistent_dirty_bitmap

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
Interface for removing persistent bitmap from its storage. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Reviewed-by: John Snow --- block/dirty-bitmap.c | 18 ++

[Qemu-block] [PATCH v22 11/30] qcow2: autoloading dirty bitmaps

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
Auto loading bitmaps are bitmaps in Qcow2, with the AUTO flag set. They are loaded when the image is opened and become BdrvDirtyBitmaps for the corresponding drive. Extra data in bitmaps is not supported for now. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by:

[Qemu-block] [PATCH v22 24/30] qmp: add autoload parameter to block-dirty-bitmap-add

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
Optional. Default is false. Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Denis V. Lunev Reviewed-by: Max Reitz Reviewed-by: John Snow --- blockdev.c | 18 --

[Qemu-block] [PATCH v22 02/30] specs/qcow2: do not use wording 'bitmap header'

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
A bitmap directory entry is sometimes called a 'bitmap header'. This patch leaves only one name - 'bitmap directory entry'. The name 'bitmap header' creates misunderstandings with 'qcow2 header' and 'qcow2 bitmap header extension' (which is extension of qcow2 header) Signed-off-by: Vladimir

[Qemu-block] [PATCH v22 28/30] qcow2: add .bdrv_remove_persistent_dirty_bitmap

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
Realize .bdrv_remove_persistent_dirty_bitmap interface. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Reviewed-by: John Snow --- block/qcow2-bitmap.c | 41 +

[Qemu-block] [PATCH v22 12/30] block: refactor bdrv_reopen_commit

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
Add bs local variable to simplify code. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow --- block.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/block.c b/block.c index 694396281b..37d68e3276

[Qemu-block] [PATCH v22 29/30] qmp: block-dirty-bitmap-remove: remove persistent

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
Remove persistent bitmap from the storage on block-dirty-bitmap-remove. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Reviewed-by: John Snow --- blockdev.c | 10 ++ qapi/block-core.json | 3

[Qemu-block] [PATCH v22 06/30] block/dirty-bitmap: add deserialize_ones func

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
Add bdrv_dirty_bitmap_deserialize_ones() function, which is needed for qcow2 bitmap loading, to handle unallocated bitmap parts, marked as all-ones. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Kevin Wolf Reviewed-by: John Snow

[Qemu-block] [PATCH v22 03/30] hbitmap: improve dirty iter

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
Make dirty iter resistant to resetting bits in corresponding HBitmap. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Reviewed-by: John Snow --- include/qemu/hbitmap.h | 26 --

[Qemu-block] [PATCH v22 16/30] block: bdrv_close: release bitmaps after drv->bdrv_close

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
Release bitmaps after 'if (bs->drv) { ... }' block. This will allow format driver to save persistent bitmaps, which will appear in following commits. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block.c | 6 +++--- 1 file

[Qemu-block] [PATCH v22 30/30] block: release persistent bitmaps on inactivate

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
We should release them here to reload on invalidate cache. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block.c | 4 block/dirty-bitmap.c | 29 +++--

[Qemu-block] [PATCH v22 04/30] tests: add hbitmap iter test

2017-06-28 Thread Vladimir Sementsov-Ogievskiy
Test that hbitmap iter is resistant to bitmap resetting. Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Denis V. Lunev Reviewed-by: Max Reitz Reviewed-by: John Snow --- tests/test-hbitmap.c | 19

Re: [Qemu-block] [Qemu-devel] [RFC] QMP design: Fixing query-block and friends

2017-06-28 Thread Markus Armbruster
Kevin Wolf writes: > Am 28.06.2017 um 09:10 hat Markus Armbruster geschrieben: >> Eric Blake writes: >> > On 06/27/2017 11:31 AM, Kevin Wolf wrote: >> >> If that's what we're going to do, I think I can figure out something >> >> nice for block nodes. That

Re: [Qemu-block] [PATCH RFC v3 2/8] block: Add aio_context field in ThrottleGroupMember

2017-06-28 Thread Kevin Wolf
Am 23.06.2017 um 14:46 hat Manos Pitsidianakis geschrieben: > timer_cb() needs to know about the current Aio context of the throttle > request that is woken up. In order to make ThrottleGroupMember backend > agnostic, this information is stored in an aio_context field instead of > accessing it

Re: [Qemu-block] [PATCH RFC v3 8/8] block: add throttle block filter driver interface tests

2017-06-28 Thread Kevin Wolf
Am 23.06.2017 um 14:47 hat Manos Pitsidianakis geschrieben: > Signed-off-by: Manos Pitsidianakis This one doesn't apply because the reference output contains a too long line and a newline was inserted. I think QMP pretty printing can help to avoid overly long lines. Kevin

Re: [Qemu-block] [PULL 11/61] virtio-pci: use ioeventfd even when KVM is disabled

2017-06-28 Thread Kevin Wolf
Am 28.06.2017 um 12:11 hat QingFeng Hao geschrieben: > 在 2017/6/24 0:21, Kevin Wolf 写道: > >From: Stefan Hajnoczi > > > >Old kvm.ko versions only supported a tiny number of ioeventfds so > >virtio-pci avoids ioeventfds when kvm_has_many_ioeventfds() returns 0. > > > >Do not

Re: [Qemu-block] [PULL 11/61] virtio-pci: use ioeventfd even when KVM is disabled

2017-06-28 Thread QingFeng Hao
在 2017/6/24 0:21, Kevin Wolf 写道: From: Stefan Hajnoczi Old kvm.ko versions only supported a tiny number of ioeventfds so virtio-pci avoids ioeventfds when kvm_has_many_ioeventfds() returns 0. Do not check kvm_has_many_ioeventfds() when KVM is disabled since it always

Re: [Qemu-block] [Qemu-devel] [RFC] QMP design: Fixing query-block and friends

2017-06-28 Thread Kevin Wolf
Am 28.06.2017 um 09:10 hat Markus Armbruster geschrieben: > Eric Blake writes: > > On 06/27/2017 11:31 AM, Kevin Wolf wrote: > >> If that's what we're going to do, I think I can figure out something > >> nice for block nodes. That shouldn't be too hard. The only question > >>

Re: [Qemu-block] [PATCH v3 18/20] block: Make bdrv_is_allocated() byte-based

2017-06-28 Thread Juan Quintela
Eric Blake wrote: > We are gradually moving away from sector-based interfaces, towards > byte-based. In the common case, allocation is unlikely to ever use > values that are not naturally sector-aligned, but it is possible > that byte-based values will let us be more precise

Re: [Qemu-block] [PATCH v3 19/20] block: Minimize raw use of bds->total_sectors

2017-06-28 Thread Manos Pitsidianakis
On Tue, Jun 27, 2017 at 02:24:57PM -0500, Eric Blake wrote: bdrv_is_allocated_above() was relying on intermediate->total_sectors, which is a field that can have stale contents depending on the value of intermediate->has_variable_length. An audit shows that we are safe (we were first calling

  1   2   >