Re: [Qemu-block] [PATCH v4 3/3] tests: Add unit tests for image locking

2018-10-01 Thread Max Reitz
On 21.08.18 02:58, Fam Zheng wrote: > Signed-off-by: Fam Zheng > --- > tests/Makefile.include | 2 + > tests/test-image-locking.c | 154 + > 2 files changed, 156 insertions(+) > create mode 100644 tests/test-image-locking.c > > diff --git a/tests/Makefi

Re: [Qemu-block] [PATCH v4 2/3] file-posix: Drop s->lock_fd

2018-10-01 Thread Max Reitz
On 21.08.18 02:58, Fam Zheng wrote: > The lock_fd field is not strictly necessary because transferring locked > bytes from old fd to the new one shouldn't fail anyway. This spares the > user one fd per image. > > Signed-off-by: Fam Zheng > --- > block/file-posix.c | 37 +-

Re: [Qemu-block] [PATCH v4 1/3] file-posix: Skip effectiveless OFD lock operations

2018-10-01 Thread Max Reitz
On 21.08.18 02:58, Fam Zheng wrote: > If we know we've already locked the bytes, don't do it again; similarly > don't unlock a byte if we haven't locked it. This doesn't change the > behavior, but fixes a corner case explained below. > > Libvirt had an error handling bug that an image can get its

Re: [Qemu-block] [PATCH v3 2/3] scripts: add render_block_graph function for QEMUMachine

2018-10-01 Thread Max Reitz
On 23.08.18 17:46, Vladimir Sementsov-Ogievskiy wrote: > Render block nodes graph with help of graphviz. This new function is > for debugging, so there is no sense to put it into qemu.py as a method > of QEMUMachine. Let's instead put it separately. > > Signed-off-by: Vladimir Sementsov-Ogievskiy

[Qemu-block] [PULL 22/23] test-replication: Lock AioContext around blk_unref()

2018-10-01 Thread Kevin Wolf
Recently, the test case has started failing because some job related functions want to drop the AioContext lock even though it hasn't been taken: (gdb) bt #0 0x7f51c067c9fb in raise () from /lib64/libc.so.6 #1 0x7f51c067e77d in abort () from /lib64/libc.so.6 #2 0x558

[Qemu-block] [PULL 09/23] block: Allow changing 'discard' on reopen

2018-10-01 Thread Kevin Wolf
From: Alberto Garcia 'discard' is one of the basic BlockdevOptions available for all drivers, but it's not handled by bdrv_reopen_prepare() so any attempt to change it results in an error: (qemu) qemu-io virtio0 "reopen -o discard=on" Cannot change the option 'discard' Since there's no re

[Qemu-block] [PULL 15/23] qcow2: Assign the L2 cache relatively to the image size

2018-10-01 Thread Kevin Wolf
From: Leonid Bloch Sufficient L2 cache can noticeably improve the performance when using large images with frequent I/O. Previously, unless 'cache-size' was specified and was large enough, the L2 cache was set to a certain size without taking the virtual image size into account. Now, the L2 cac

[Qemu-block] [PULL 16/23] qcow2: Increase the default upper limit on the L2 cache size

2018-10-01 Thread Kevin Wolf
From: Leonid Bloch The upper limit on the L2 cache size is increased from 1 MB to 32 MB on Linux platforms, and to 8 MB on other platforms (this difference is caused by the ability to set intervals for cache cleaning on Linux platforms only). This is done in order to allow default full coverage

[Qemu-block] [PULL 12/23] include: Add a lookup table of sizes

2018-10-01 Thread Kevin Wolf
From: Leonid Bloch Adding a lookup table for the powers of two, with the appropriate size prefixes. This is needed when a size has to be stringified, in which case something like '(1 * KiB)' would become a literal '(1 * (1L << 10))' string. Powers of two are used very often for sizes, so such a t

[Qemu-block] [PULL 18/23] qcow2: Set the default cache-clean-interval to 10 minutes

2018-10-01 Thread Kevin Wolf
From: Leonid Bloch The default cache-clean-interval is set to 10 minutes, in order to lower the overhead of the qcow2 caches (before the default was 0, i.e. disabled). * For non-Linux platforms the default is kept at 0, because cache-clean-interval is not supported there yet. Signed-off-by: L

[Qemu-block] [PULL 13/23] qcow2: Make sizes more humanly readable

2018-10-01 Thread Kevin Wolf
From: Leonid Bloch Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/qcow2.h | 9 + block/qcow2.c | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/block/qcow2.h b/block/qcow2.h index 81b844e936..a

[Qemu-block] [PULL 19/23] qcow2: Explicit number replaced by a constant

2018-10-01 Thread Kevin Wolf
From: Leonid Bloch Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/qcow2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 95e1c98daa..7277feda13 100644 --- a/block

[Qemu-block] [PULL 05/23] block: Don't look for child references in append_open_options()

2018-10-01 Thread Kevin Wolf
From: Alberto Garcia In the previous patch we removed child references from bs->options, so there's no need to look for them here anymore. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz Signed-off-by: Kevin Wolf --- block.c | 13 + 1 file changed, 1 insertion(+), 12 deletio

[Qemu-block] [PULL 11/23] qcow2: Options' documentation fixes

2018-10-01 Thread Kevin Wolf
From: Leonid Bloch Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- docs/qcow2-cache.txt | 21 ++--- qemu-options.hx | 9 ++--- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/docs/qcow2-c

[Qemu-block] [PULL 07/23] block: Forbid trying to change unsupported options during reopen

2018-10-01 Thread Kevin Wolf
From: Alberto Garcia The bdrv_reopen_prepare() function checks all options passed to each BlockDriverState (in the reopen_state->options QDict) and makes all necessary preparations to apply the option changes requested by the user. Options are removed from the QDict as they are processed, so at

[Qemu-block] [PULL 14/23] qcow2: Avoid duplication in setting the refcount cache size

2018-10-01 Thread Kevin Wolf
From: Leonid Bloch The refcount cache size does not need to be set to its minimum value in read_cache_sizes(), as it is set to at least its minimum value in qcow2_update_options_prepare(). Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wol

[Qemu-block] [PULL 20/23] block-backend: Set werror/rerror defaults in blk_new()

2018-10-01 Thread Kevin Wolf
Currently, the default values for werror and rerror have to be set explicitly with blk_set_on_error() by the callers of blk_new(). The only caller actually doing this is blockdev_init(), which is called for BlockBackends created using -drive. In particular, anonymous BlockBackends created with -de

[Qemu-block] [PULL 17/23] qcow2: Resize the cache upon image resizing

2018-10-01 Thread Kevin Wolf
From: Leonid Bloch The caches are now recalculated upon image resizing. This is done because the new default behavior of assigning L2 cache relatively to the image size, implies that the cache will be adapted accordingly after an image resize. Signed-off-by: Leonid Bloch Reviewed-by: Alberto Ga

[Qemu-block] [PULL 10/23] block: Allow changing 'detect-zeroes' on reopen

2018-10-01 Thread Kevin Wolf
From: Alberto Garcia 'detect-zeroes' is one of the basic BlockdevOptions available for all drivers, but it's not handled by bdrv_reopen_prepare(), so any attempt to change it results in an error: (qemu) qemu-io virtio0 "reopen -o detect-zeroes=on" Cannot change the option 'detect-zeroes'

[Qemu-block] [PULL 23/23] tests/test-bdrv-drain: Fix too late qemu_event_reset()

2018-10-01 Thread Kevin Wolf
qemu_event_reset() must be called before the AIO request in a different iothread is submitted. Otherwise the request could be completed before we do the qemu_event_reset() and the test would hang in qemu_event_wait(). Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Tested-by: Max Reitz --- te

[Qemu-block] [PULL 21/23] qcow2: Fix cache-clean-interval documentation

2018-10-01 Thread Kevin Wolf
From: Leonid Bloch Fixing cache-clean-interval documentation following the recent change to a default of 600 seconds on supported plarforms (only Linux currently). Signed-off-by: Leonid Bloch Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- qapi/block-core.json | 3 ++- docs/qcow2-cach

[Qemu-block] [PULL 08/23] file-posix: Forbid trying to change unsupported options during reopen

2018-10-01 Thread Kevin Wolf
From: Alberto Garcia The file-posix code is used for the "file", "host_device" and "host_cdrom" drivers, and it allows reopening images. However the only option that is actually processed is "x-check-cache-dropped", and changes in all other options (e.g. "filename") are silently ignored: (qem

[Qemu-block] [PULL 04/23] block: Remove child references from bs->{options, explicit_options}

2018-10-01 Thread Kevin Wolf
From: Alberto Garcia Block drivers allow opening their children using a reference to an existing BlockDriverState. These references remain stored in the 'options' and 'explicit_options' QDicts, but we don't need to keep them once everything is open. What is more important, these values can becom

[Qemu-block] [PULL 06/23] block: Allow child references on reopen

2018-10-01 Thread Kevin Wolf
From: Alberto Garcia In the previous patches we removed all child references from bs->{options,explicit_options} because keeping them is useless and wrong. Because of this, any attempt to reopen a BlockDriverState using a child reference as one of its options would result in a failure, because b

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

2018-10-01 Thread Kevin Wolf
The following changes since commit 07f426c35eddd79388a23d11cb278600d7e3831d: Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20180926' into staging (2018-09-28 18:56:09 +0100) are available in the git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for you to fetch

[Qemu-block] [PULL 02/23] qemu-io: Fix writethrough check in reopen

2018-10-01 Thread Kevin Wolf
From: Alberto Garcia "qemu-io reopen" doesn't allow changing the writethrough setting of the cache, but the check is wrong, causing an error even on a simple reopen with the default parameters: $ qemu-img create -f qcow2 hd.qcow2 1M $ qemu-system-x86_64 -monitor stdio -drive if=virtio,file

[Qemu-block] [PULL 03/23] file-posix: x-check-cache-dropped should default to false on reopen

2018-10-01 Thread Kevin Wolf
From: Alberto Garcia The default value of x-check-cache-dropped is false. There's no reason to use the previous value as a default in raw_reopen_prepare() because bdrv_reopen_queue_child() already takes care of putting the old options in the BDRVReopenState.options QDict. If x-check-cache-droppe

[Qemu-block] [PULL 01/23] file-posix: Include filename in locking error message

2018-10-01 Thread Kevin Wolf
From: Fam Zheng Image locking errors happening at device initialization time doesn't say which file cannot be locked, for instance, -device scsi-disk,drive=drive-1: Failed to get shared "write" lock Is another process using the image? could refer to either the overlay image or its backi

Re: [Qemu-block] [PATCH] qcow2: Fix cache-clean-interval documentation

2018-10-01 Thread Kevin Wolf
Am 01.10.2018 um 16:35 hat Eric Blake geschrieben: > On 9/29/18 4:54 AM, Leonid Bloch wrote: > > Fixing cache-clean-interval documentation following the recent change to > > a default of 600 seconds on supported plarforms (only Linux currently). > > > > Signed-off-by: Leonid Bloch > > --- > > d

Re: [Qemu-block] [PATCH 4/7] qcow2: async scheme for qcow2_co_preadv

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
01.10.2018 18:49, Max Reitz wrote: On 01.10.18 17:33, Vladimir Sementsov-Ogievskiy wrote: 27.09.2018 21:35, Max Reitz wrote: On 07.08.18 19:43, Vladimir Sementsov-Ogievskiy wrote: Start several async requests instead of read chunk by chunk. Signed-off-by: Vladimir Sementsov-Ogievskiy ---  

Re: [Qemu-block] [PATCH] test-replication: Lock AioContext around blk_unref()

2018-10-01 Thread Paolo Bonzini
On 01/10/2018 18:03, Kevin Wolf wrote: >> Given the backtrace, I think bdrv_close should be taking the AioContext >> lock instead of blockdev_close_all_bdrv_states. > Conversely, that would mean that calling bdrv_unref() with the > AioContext lock held is a bug (because close callbacks can involve

Re: [Qemu-block] [PATCH] tests/test-bdrv-drain: Fix too late qemu_event_reset()

2018-10-01 Thread Max Reitz
On 01.10.18 17:10, Kevin Wolf wrote: > qemu_event_reset() must be called before the AIO request in a different > iothread is submitted. Otherwise the request could be completed before > we do the qemu_event_reset() and the test would hang in > qemu_event_wait(). > > Signed-off-by: Kevin Wolf > --

Re: [Qemu-block] [PULL 00/42] Block patches

2018-10-01 Thread Kevin Wolf
Am 01.10.2018 um 16:14 hat Kevin Wolf geschrieben: > Am 01.10.2018 um 15:03 hat Peter Maydell geschrieben: > > On 28 September 2018 at 15:36, Peter Maydell > > wrote: > > > I'm finding that test-bdrv-drain hangs intermittently on my OSX host. > > > > Ping? Between this and test-replication I'm f

Re: [Qemu-block] [PATCH] test-replication: Lock AioContext around blk_unref()

2018-10-01 Thread Kevin Wolf
Am 01.10.2018 um 17:40 hat Paolo Bonzini geschrieben: > On 01/10/2018 16:32, Kevin Wolf wrote: > > Recently, the test case has started failing because some job related > > functions want to drop the AioContext lock even though it hasn't been > > taken: > > > > (gdb) bt > > #0 0x7f51c0

Re: [Qemu-block] [PATCH 3/7] qcow2: split out reading normal clusters from qcow2_co_preadv

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
01.10.2018 18:39, Max Reitz wrote: On 01.10.18 17:14, Vladimir Sementsov-Ogievskiy wrote: 27.09.2018 20:35, Max Reitz wrote: On 07.08.18 19:43, Vladimir Sementsov-Ogievskiy wrote: Memory allocation may become less efficient for encrypted case. It's a payment for further asynchronous scheme. S

Re: [Qemu-block] [PATCH 1/7] qcow2: move qemu_co_mutex_lock below decryption procedure

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
27.09.2018 20:02, Max Reitz wrote: On 27.09.18 18:58, Max Reitz wrote: On 07.08.18 19:43, Vladimir Sementsov-Ogievskiy wrote: From: "Denis V. Lunev" We are not working with a shared state data in the decruption code and (*decryption) thus this operation is safe. On the other hand this sign

Re: [Qemu-block] [PATCH 4/7] qcow2: async scheme for qcow2_co_preadv

2018-10-01 Thread Max Reitz
On 01.10.18 17:33, Vladimir Sementsov-Ogievskiy wrote: > 27.09.2018 21:35, Max Reitz wrote: >> On 07.08.18 19:43, Vladimir Sementsov-Ogievskiy wrote: >>> Start several async requests instead of read chunk by chunk. >>> >>> Signed-off-by: Vladimir Sementsov-Ogievskiy >>> --- >>>   block/qcow2.c | 2

Re: [Qemu-block] [PATCH 5/7] qcow2: refactor qcow2_co_pwritev: split out qcow2_co_do_pwritev

2018-10-01 Thread Max Reitz
On 01.10.18 17:43, Vladimir Sementsov-Ogievskiy wrote: > 28.09.2018 17:23, Max Reitz wrote: >> On 07.08.18 19:43, Vladimir Sementsov-Ogievskiy wrote: >>> Split out block which will be reused in async scheme. >>> >>> Signed-off-by: Vladimir Sementsov-Ogievskiy >>> --- >>>   block/qcow2.c | 138 >>>

Re: [Qemu-block] [PATCH 7/7] qcow2: async scheme for qcow2_co_pwritev

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
28.09.2018 17:35, Max Reitz wrote: On 07.08.18 19:43, Vladimir Sementsov-Ogievskiy wrote: Start several async requests instead of read chunk by chunk. Iotest 026 output is changed, as because of async io error path has changed. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/qcow2.c

Re: [Qemu-block] [PATCH 5/7] qcow2: refactor qcow2_co_pwritev: split out qcow2_co_do_pwritev

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
28.09.2018 17:23, Max Reitz wrote: On 07.08.18 19:43, Vladimir Sementsov-Ogievskiy wrote: Split out block which will be reused in async scheme. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/qcow2.c | 138 -- 1 file changed, 86

Re: [Qemu-block] [PATCH] test-replication: Lock AioContext around blk_unref()

2018-10-01 Thread Paolo Bonzini
On 01/10/2018 16:32, Kevin Wolf wrote: > Recently, the test case has started failing because some job related > functions want to drop the AioContext lock even though it hasn't been > taken: > > (gdb) bt > #0 0x7f51c067c9fb in raise () from /lib64/libc.so.6 > #1 0x7f51c067e77

Re: [Qemu-block] [PATCH 3/7] qcow2: split out reading normal clusters from qcow2_co_preadv

2018-10-01 Thread Max Reitz
On 01.10.18 17:14, Vladimir Sementsov-Ogievskiy wrote: > 27.09.2018 20:35, Max Reitz wrote: >> On 07.08.18 19:43, Vladimir Sementsov-Ogievskiy wrote: >>> Memory allocation may become less efficient for encrypted case. It's a >>> payment for further asynchronous scheme. >>> >>> Signed-off-by: Vladim

Re: [Qemu-block] [PATCH 4/7] qcow2: async scheme for qcow2_co_preadv

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
27.09.2018 21:35, Max Reitz wrote: On 07.08.18 19:43, Vladimir Sementsov-Ogievskiy wrote: Start several async requests instead of read chunk by chunk. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/qcow2.c | 208 -- 1 file chang

Re: [Qemu-block] [PATCH 3/7] qcow2: split out reading normal clusters from qcow2_co_preadv

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
27.09.2018 20:35, Max Reitz wrote: On 07.08.18 19:43, Vladimir Sementsov-Ogievskiy wrote: Memory allocation may become less efficient for encrypted case. It's a payment for further asynchronous scheme. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/qcow2.c | 114 ++

[Qemu-block] [PATCH] tests/test-bdrv-drain: Fix too late qemu_event_reset()

2018-10-01 Thread Kevin Wolf
qemu_event_reset() must be called before the AIO request in a different iothread is submitted. Otherwise the request could be completed before we do the qemu_event_reset() and the test would hang in qemu_event_wait(). Signed-off-by: Kevin Wolf --- tests/test-bdrv-drain.c | 4 ++-- 1 file changed

Re: [Qemu-block] [PATCH] qcow2: Fix cache-clean-interval documentation

2018-10-01 Thread Eric Blake
On 9/29/18 4:54 AM, Leonid Bloch wrote: Fixing cache-clean-interval documentation following the recent change to a default of 600 seconds on supported plarforms (only Linux currently). Signed-off-by: Leonid Bloch --- docs/qcow2-cache.txt | 19 +-- qapi/block-core.json | 3 ++

[Qemu-block] [PATCH] test-replication: Lock AioContext around blk_unref()

2018-10-01 Thread Kevin Wolf
Recently, the test case has started failing because some job related functions want to drop the AioContext lock even though it hasn't been taken: (gdb) bt #0 0x7f51c067c9fb in raise () from /lib64/libc.so.6 #1 0x7f51c067e77d in abort () from /lib64/libc.so.6 #2 0x558

Re: [Qemu-block] [PULL 00/42] Block patches

2018-10-01 Thread Kevin Wolf
Am 01.10.2018 um 15:03 hat Peter Maydell geschrieben: > On 28 September 2018 at 15:36, Peter Maydell wrote: > > I'm finding that test-bdrv-drain hangs intermittently on my OSX host. > > Ping? Between this and test-replication I'm finding that my > parallel build tests for merges are failing about

[Qemu-block] [PATCH] tests: Disable test-bdrv-drain and test-replication

2018-10-01 Thread Peter Maydell
The test-bdrv-drain and test-replication tests have intermittent errors which make my build testing process fail way too often. Disable them both for the moment. Signed-off-by: Peter Maydell --- I'm having trouble making forward progress with applying merges because of these flaky tests :-( tes

Re: [Qemu-block] [PULL 00/42] Block patches

2018-10-01 Thread Peter Maydell
On 28 September 2018 at 15:36, Peter Maydell wrote: > I'm finding that test-bdrv-drain hangs intermittently on my OSX host. Ping? Between this and test-replication I'm finding that my parallel build tests for merges are failing about 50% of the time :-( If there's no immediate sign of a fix, cou

[Qemu-block] [PATCH v3 07/18] block/backup: allow use existent copy-bitmap

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
Allow use existent copy-bitmap to make it possible to synchronize with externally created fleecing-hook filter which will be introduced soon. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/backup.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/block/b

[Qemu-block] [PATCH v3 09/18] block: improve should_update_child

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
As it already said in the comment, we don't want to create loops in parent->child relations. So, when we try to append @to to @c, we should check that @c is not in @to children subtree, and we should check it recursively, not only the first level. The patch provides BFS-based search, to check the r

[Qemu-block] [PATCH v3 11/18] iotests: allow resume_drive by node name

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
After node graph changes, we may not be able to resume_drive by device name (backing files are not recursively searched). So, lets allow to resume by node-name. Set constant name for breakpoints, to avoid introducing extra parameters. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-io

[Qemu-block] [PATCH v3 04/18] block/backup: move from HBitmap to BdrvDirtyBitmap

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
This is a necessary step to share copy-bitmap between backup job and special filter driver in further commit. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/backup.c | 73 -- 1 file changed, 41 insertions(+), 32 deletions(-) diff --git a/bl

[Qemu-block] [PATCH v3 18/18] block/backup: use fleecing-hook instead of write notifiers

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
Drop write notifiers and use filter node instead. Changes: 1. copy-before-writes now handled by filter node, so, drop all is_write_notifier arguments. 2. we don't have intersecting requests, so their handling is dropped. Instead, synchronization works as follows: when backup or fleecing-hook s

[Qemu-block] [PATCH v3 16/18] iotests: test new fleecing-hook driver in context of 222 iotest

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/222 | 59 +++--- tests/qemu-iotests/222.out | 66 ++ 2 files changed, 114 insertions(+), 11 deletions(-) diff --git a/tests/qemu-iotests/222 b/tests/qemu-iotests

[Qemu-block] [PATCH v3 14/18] block/fleecing-hook: internal api

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
Add some functions to use fleecing-hook internally from backup job in further commit. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block.h | 9 block/fleecing-hook.c | 51 +++ 2 files changed, 60 insertions(+) diff --git a/inclu

[Qemu-block] [PATCH v3 01/18] block/dirty-bitmap: allow set/reset bits in disabled bitmaps

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
It is needed for use the bitmaps in backup. "disabled" means that bitmap is not auto set by writes. Let's allow changing bitmap for other uses. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/dirty-bitmap.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/block/dirty-bitmap.c b/block/d

[Qemu-block] [PATCH v3 02/18] block/io: allow BDRV_REQ_SERIALISING for read

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
It will be used in further commit, changing backup architecture. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/io.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/block/io.c b/block/io.c index bd9d688f8b..b003b4d5bf 100644 --- a/block/io.c +++ b/block/i

[Qemu-block] [PATCH v3 08/18] block: allow serialized reads to intersect

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
Otherwise, if we have serialized read-part in copy_range from backing file to its parent if CoW take place, this CoW's sub-reads will intersect with firstly created serialized read request. Anyway, reads should not influence on disk view, let's allow them to intersect. Signed-off-by: Vladimir Sem

[Qemu-block] [PATCH v3 15/18] qapi: add x-drop-fleecing qmp command

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
To insert fleecing-hook, it should be just created (blockdev-add) with corresponding parameters. But it can't be properly removed by blockdev-del (we can't restore backing chain in fleecing-hook .close), So, let's add this expiremental api to drop the hook. Signed-off-by: Vladimir Sementsov-Ogievs

[Qemu-block] [PATCH v3 17/18] block/backup: tiny refactor backup_job_create

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
Move copy-bitmap find/create code. It's needed for the following commit, as we'll need copy_bitmap before actual block job creation. Do it in a separate commit to simplify review. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/backup.c | 95 +++-

[Qemu-block] [PATCH v3 12/18] iotests: prepare 055 to graph changes during backup job

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
Backup will append fleecing-hook node above source node, so, we can't resume by device name (because resume don't search recursively through backing chain). Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/055 | 23 +-- 1 file changed, 13 insertions(+), 10 d

[Qemu-block] [PATCH v3 10/18] iotests: handle -f argument correctly for qemu_io_silent

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
Correctly rewrite default argument. After the patch, the function can be used for other (not only default test-chosen) image format. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/iotests.py | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/qemu-

[Qemu-block] [PATCH v3 13/18] block: introduce new filter driver: fleecing-hook

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
Fleecing-hook filter does copy-before-write operation. It should be inserted above active disk and has a target node for CBW, like the following: +---+ | Guest | +---+---+ |r,w v +---+---+ target +---+ | Fleecing hook |-->| tar

[Qemu-block] [PATCH v3 06/18] block/backup: give a name to copy-bitmap

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
The bitmap should be named to be shared with special filter node in further patches. Make it possible to set this name in qmp command. Signed-off-by: Vladimir Sementsov-Ogievskiy --- qapi/block-core.json | 18 -- include/block/block_int.h | 2 +- block/backup.c|

[Qemu-block] [PATCH v3 00/18] fleecing-hook driver for backup

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
v2 was "[RFC v2] new, node-graph-based fleecing and backup" Hi all! These series introduce fleecing-hook driver. It's a filter-node, which do copy-before-write operation. Mirror uses filter-node for handling guest writes, let's move to filter-node (from write-notifiers) for backup too (patch 18)

[Qemu-block] [PATCH v3 05/18] util/id: add block-bitmap subsystem

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
Add block-bitmap subsystem to generate bitmap names in the following commit. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/qemu/id.h | 1 + util/id.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/qemu/id.h b/include/qemu/id.h index 40c70103e4..013a560e01 100644

[Qemu-block] [PATCH v3 03/18] block/backup: simplify backup_incremental_init_copy_bitmap

2018-10-01 Thread Vladimir Sementsov-Ogievskiy
Simplify backup_incremental_init_copy_bitmap using the function bdrv_dirty_bitmap_next_dirty_area. Note: move to job->len instead of bitmap size: it should not matter but less code. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/backup.c | 40 1 f