Re: [Qemu-block] [PATCH 07/21] qcow2: add bitmaps extension

2016-12-21 Thread Vladimir Sementsov-Ogievskiy
16.12.2016 17:25, Max Reitz wrote: On 14.12.2016 13:23, Vladimir Sementsov-Ogievskiy wrote: 07.12.2016 21:25, Max Reitz wrote: On 22.11.2016 18:26, Vladimir Sementsov-Ogievskiy wrote: Add bitmap extension as specified in docs/specs/qcow2.txt. For now, just mirror extension header into Qcow2 st

Re: [Qemu-block] [PATCH 4/4] block: Add VFIO based NVMe driver

2016-12-21 Thread Stefan Hajnoczi
On Wed, Dec 21, 2016 at 12:31:39AM +0800, Fam Zheng wrote: > This is a new protocol driver that exclusively opens a host NVMe > controller through VFIO. It achieves better latency than linux-aio. This is an interesting block driver to have for performance comparisons. Definitely something that is

[Qemu-block] [PATCH 02/10] qemu-thread: introduce QemuLockCnt

2016-12-21 Thread Paolo Bonzini
A QemuLockCnt comprises a counter and a mutex, with primitives to increment and decrement the counter, and to take and release the mutex. It can be used to do lock-free visits to a data structure whenever mutexes would be too heavy-weight and the critical section is too long for RCU. This could b

[Qemu-block] [PATCH 03/10] aio: make ctx->list_lock a QemuLockCnt, subsuming ctx->walking_bh

2016-12-21 Thread Paolo Bonzini
This will make it possible to walk the list of bottom halves without holding the AioContext lock---and in turn to call bottom half handlers without holding the lock. Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- async.c | 35 --- inclu

[Qemu-block] [PATCH 05/10] aio-posix: split aio_dispatch_handlers out of aio_dispatch

2016-12-21 Thread Paolo Bonzini
This simplifies the handling of dispatch_fds. Signed-off-by: Paolo Bonzini --- aio-posix.c | 43 +-- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/aio-posix.c b/aio-posix.c index 1585571..25198d9 100644 --- a/aio-posix.c +++ b/aio-posix.c

[Qemu-block] [PATCH v2 00/10] aio_context_acquire/release pushdown, part 1

2016-12-21 Thread Paolo Bonzini
This is the first step of pushing down the AioContext lock. Bottom halves are already protected by their own lock, use it also for walking_bh and for the handlers list (including walking_handlers). The (lock, walking_foo) pair is wrapped into the QemuLockCnt primitive. Paolo v1->v2: reb

[Qemu-block] [PATCH 01/10] aio: rename bh_lock to list_lock

2016-12-21 Thread Paolo Bonzini
This will be used for AioHandlers too. There is going to be little or no contention, so it is better to reuse the same lock. Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- async.c | 20 ++-- include/block/aio.h | 2 +- 2 files changed, 11 insertions(

[Qemu-block] [PATCH 07/10] aio-posix: remove walking_handlers, protecting AioHandler list with list_lock

2016-12-21 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- aio-posix.c | 64 - 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/aio-posix.c b/aio-posix.c index f83b7af..9b13182 100644 --- a/aio-posix.c +++ b/aio-posix.c @@ -16,7 +16,7 @@ #include

[Qemu-block] [PATCH 06/10] aio: tweak walking in dispatch phase

2016-12-21 Thread Paolo Bonzini
Preparing for the following patch, use QLIST_FOREACH_SAFE and modify the placement of walking_handlers increment/decrement. Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- aio-posix.c | 26 -- aio-win32.c | 26 -- 2 files changed, 24

[Qemu-block] [PATCH 04/10] qemu-thread: optimize QemuLockCnt with futexes on Linux

2016-12-21 Thread Paolo Bonzini
This is complex, but I think it is reasonably documented in the source. Signed-off-by: Paolo Bonzini --- docs/lockcnt.txt | 9 +- include/qemu/futex.h | 36 ++ include/qemu/thread.h| 2 + util/lockcnt.c | 282 +++ uti

[Qemu-block] [PATCH 09/10] aio: document locking

2016-12-21 Thread Paolo Bonzini
Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- docs/multiple-iothreads.txt | 13 + include/block/aio.h | 32 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/docs/multiple-iothreads.txt b/docs/multiple-iothreads.

[Qemu-block] [PATCH 08/10] aio-win32: remove walking_handlers, protecting AioHandler list with list_lock

2016-12-21 Thread Paolo Bonzini
Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- aio-win32.c | 73 +++-- 1 file changed, 47 insertions(+), 26 deletions(-) diff --git a/aio-win32.c b/aio-win32.c index 1ad459d..900524c 100644 --- a/aio-win32.c +++ b/aio-win32.

[Qemu-block] [PATCH 10/10] async: optimize aio_bh_poll

2016-12-21 Thread Paolo Bonzini
Avoid entering the slow path of qemu_lockcnt_dec_and_lock if no bottom half has to be deleted. Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- async.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/async.c b/async.c index 2305e11..0d218ab 100644 ---

Re: [Qemu-block] [PATCH 4/4] block: Add VFIO based NVMe driver

2016-12-21 Thread Fam Zheng
On Wed, 12/21 11:59, Stefan Hajnoczi wrote: > On Wed, Dec 21, 2016 at 12:31:39AM +0800, Fam Zheng wrote: > > This is a new protocol driver that exclusively opens a host NVMe > > controller through VFIO. It achieves better latency than linux-aio. > > This is an interesting block driver to have for

Re: [Qemu-block] [PATCH for-2.9 v3 0/5] Sheepdog cleanups

2016-12-21 Thread Paolo Bonzini
On 29/11/2016 12:32, Paolo Bonzini wrote: > Cleaning up the code and removing duplication makes it simpler to > later adapt it for the multiqueue work. > > Tested against sheepdog 1.0. I also tested taking snapshots and reverting > to older snapshots, but the latter only worked with "dog vdi ro

Re: [Qemu-block] [PATCH 18/24] qmp: add x-debug-block-dirty-bitmap-sha256

2016-12-21 Thread Vladimir Sementsov-Ogievskiy
21.12.2016 17:54, Vladimir Sementsov-Ogievskiy wrote: Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/dirty-bitmap.c | 5 + blockdev.c | 29 + include/block/dirty-bitmap.h | 2 ++ include/qemu/hbitmap.h | 8

[Qemu-block] [PATCH 11/24] block: introduce persistent dirty bitmaps

2016-12-21 Thread Vladimir Sementsov-Ogievskiy
New field BdrvDirtyBitmap.persistent means, that bitmap should be saved on bdrv_close, using format driver. Format driver should maintain bitmap storing. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block.c | 32 bl

[Qemu-block] [PATCH 23/24] qcow2: add .bdrv_remove_persistent_dirty_bitmap

2016-12-21 Thread Vladimir Sementsov-Ogievskiy
Realize .bdrv_remove_persistent_dirty_bitmap interface. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/qcow2-bitmap.c | 40 block/qcow2.c| 1 + block/qcow2.h| 3 +++ 3 files changed, 44 insertions(+) diff --git a/block/qcow2-bitm

[Qemu-block] [PATCH 09/24] qcow2: add .bdrv_load_autoloading_dirty_bitmaps

2016-12-21 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 --- block/Makefile.objs | 2 +- blo

[Qemu-block] [PATCH 19/24] iotests: test qcow2 persistent dirty bitmap

2016-12-21 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/165 | 89 ++ tests/qemu-iotests/165.out | 5 +++ tests/qemu-iotests/group | 1 + 3 files changed, 95 insertions(+) create mode 100755 tests/qemu-iotests/

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

2016-12-21 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 +++ 1 file changed, 19 insertions(+) diff --git a/tests/test-hbitmap

[Qemu-block] [PATCH 22/24] block/dirty-bitmap: deep release dirty bitmaps

2016-12-21 Thread Vladimir Sementsov-Ogievskiy
Remove persistent bitmap from its storage on bdrv_release_dirty_bitmap. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/dirty-bitmap.c | 21 ++--- include/block/block_int.h | 3 +++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/block/dirty-bitmap.c b

[Qemu-block] [PATCH 18/24] qmp: add x-debug-block-dirty-bitmap-sha256

2016-12-21 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/dirty-bitmap.c | 5 + blockdev.c | 29 + include/block/dirty-bitmap.h | 2 ++ include/qemu/hbitmap.h | 8 qapi/block-core.json | 27 +++

[Qemu-block] [PATCH 21/24] qcow2-bitmap: refcounts

2016-12-21 Thread Vladimir Sementsov-Ogievskiy
Calculate refcounts for qcow2 bitmaps. It is needed for qcow2's qemu-img check implementation. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/qcow2-bitmap.c | 80 ++ block/qcow2-refcount.c | 6 block/qcow2.h | 3 ++ 3 files

[Qemu-block] [PATCH 16/24] qmp: add persistent flag to block-dirty-bitmap-add

2016-12-21 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 --- blockdev.c| 18 +- docs/qmp-commands.txt | 3 +++ qapi/block-core.json | 7

[Qemu-block] [PATCH 24/24] qcow2-bitmap: cache bitmap list in BDRVQcow2State

2016-12-21 Thread Vladimir Sementsov-Ogievskiy
Do not reload bitmap list every time it is needed. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/qcow2-bitmap.c | 121 ++- block/qcow2.c| 2 + block/qcow2.h| 4 ++ 3 files changed, 87 insertions(+), 40 deletions(-) diff

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

2016-12-21 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow --- docs/specs/qcow2.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/specs/qcow2.txt b/docs/specs/qcow2.txt index 80cdfd0..dda53dd 100644 --- a/docs/specs/qcow2.txt +++ b/docs/specs/qcow2.txt @@ -47

[Qemu-block] [PATCH 08/24] block: introduce auto-loading bitmaps

2016-12-21 Thread Vladimir Sementsov-Ogievskiy
Auto loading bitmaps are bitmaps stored in the disk image, which should be loaded when the image is opened and become BdrvDirtyBitmaps for the corresponding drive. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow --- block.c | 14 ++ include/block

[Qemu-block] [PATCH v10 00/24] qcow2: persistent dirty bitmaps

2016-12-21 Thread Vladimir Sementsov-Ogievskiy
Hi all! There is a new update of qcow2-bitmap series - v10. web: https://src.openvz.org/users/vsementsov/repos/qemu/browse?at=qcow2-bitmap-v10 git: https://src.openvz.org/scm/~vsementsov/qemu.git (tag qcow2-bitmap-v10) v10: 07: rm John's r-b not add Max's r-b fix subject s/dirty bitmap

[Qemu-block] [PATCH 05/24] block: fix bdrv_dirty_bitmap_granularity signature

2016-12-21 Thread Vladimir Sementsov-Ogievskiy
Make getter signature const-correct. This allows other functions with const dirty bitmap parameter use bdrv_dirty_bitmap_granularity(). Reviewed-by: Eric Blake Reviewed-by: John Snow Reviewed-by: Kevin Wolf Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/dirty-bitmap.c | 2 +- i

[Qemu-block] [PATCH 14/24] block: add bdrv_can_store_new_dirty_bitmap

2016-12-21 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 --- block.c | 22 ++ include/b

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

2016-12-21 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 Sement

[Qemu-block] [PATCH 12/24] block/dirty-bitmap: add bdrv_dirty_bitmap_next()

2016-12-21 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/dirty-bitmap.c | 7 +++ include/block/dirty-bitmap.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c index 4d026df..fe34d48 100644 --- a/block/dirty-bitma

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

2016-12-21 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 -- util/hbitmap.c | 23 ++- 2 files changed, 26 i

[Qemu-block] [PATCH 07/24] qcow2: add bitmaps extension

2016-12-21 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. For now, disable image resize if it has bitmaps. It will be fixed later. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/qcow2.c | 119 +

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

2016-12-21 Thread Vladimir Sementsov-Ogievskiy
Optional. Default is false. Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Denis V. Lunev Reviewed-by: Max Reitz --- blockdev.c| 18 -- docs/qmp-commands.txt | 4 qapi/block-core.json | 6 +- 3 files changed, 25 insertions(+), 3 deletions(-)

[Qemu-block] [PATCH 13/24] qcow2: add .bdrv_store_persistent_dirty_bitmaps()

2016-12-21 Thread Vladimir Sementsov-Ogievskiy
Realize block bitmap storing interface, to allow qcow2 images store persistent bitmaps. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/qcow2-bitmap.c | 509 +-- block/qcow2.c| 1 + block/qcow2.h| 1 + 3 files changed, 496

[Qemu-block] [PATCH 15/24] qcow2: add .bdrv_can_store_new_dirty_bitmap

2016-12-21 Thread Vladimir Sementsov-Ogievskiy
Realize .bdrv_can_store_new_dirty_bitmap interface. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/qcow2-bitmap.c | 40 block/qcow2.c| 1 + block/qcow2.h| 4 3 files changed, 45 insertions(+) diff --git a/block/qcow2-bitmap.

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

2016-12-21 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 --- block/dirty-bitmap.c | 7 +++ include

[Qemu-block] [PATCH 10/24] block/dirty-bitmap: add autoload field to BdrvDirtyBitmap

2016-12-21 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 Reviewed-by: Max Reitz --- block/dirty-bitmap.c | 16 block/qcow2-bitmap.c |

[Qemu-block] [PATCH 20/24] qcow2-refcount: rename inc_refcounts() and make it public

2016-12-21 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 --- block/qcow2-refcount.c | 53 ++ block/qcow2.h | 4 2 files cha

[Qemu-block] ping Re: [PATCH v4 00/17] Dirty bitmaps postcopy migration

2016-12-21 Thread Vladimir Sementsov-Ogievskiy
Ping Hi all! What about this? 22.11.2016 20:54, Vladimir Sementsov-Ogievskiy wrote: Hi all! There is a new version of dirty bitmap postcopy migration series. v4: clone: tag postcopy-v4 from https://src.openvz.org/scm/~vsementsov/qemu.git online: https://src.openvz.org/users/vsementsov/repos/

Re: [Qemu-block] [Qemu-devel] [PATCH v10 00/24] qcow2: persistent dirty bitmaps

2016-12-21 Thread no-reply
Hi, Your series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally. Type: series Message-id: 1482332102-131788-1-git-send-email-vsement...@virtuozzo.com Subject: [Qemu-devel] [PATCH v10 00/24] q

Re: [Qemu-block] [PATCH 3/4] util: Add VFIO helper library

2016-12-21 Thread Paolo Bonzini
On 20/12/2016 17:31, Fam Zheng wrote: > +hbitmap_iter_init(&iter, s->free_chunks, 1); > +if (contiguous) { > +while (true) { > +bool satisfy = true; > +next = hbitmap_iter_next(&iter); > +if (next < 0) { > +return NULL; > +

Re: [Qemu-block] [PATCH 3/4] util: Add VFIO helper library

2016-12-21 Thread Fam Zheng
On Wed, 12/21 16:46, Paolo Bonzini wrote: > > > On 20/12/2016 17:31, Fam Zheng wrote: > > +hbitmap_iter_init(&iter, s->free_chunks, 1); > > +if (contiguous) { > > +while (true) { > > +bool satisfy = true; > > +next = hbitmap_iter_next(&iter); > > +

Re: [Qemu-block] [Qemu-devel] [PATCH v10 00/24] qcow2: persistent dirty bitmaps

2016-12-21 Thread Vladimir Sementsov-Ogievskiy
Last patch breaks it. Fix will look like diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c index b9f3d62..dd987a1 100644 --- a/block/qcow2-bitmap.c +++ b/block/qcow2-bitmap.c @@ -79,7 +79,7 @@ typedef struct Qcow2BitmapTable { } Qcow2BitmapTable; typedef QSIMPLEQ_HEAD(Qcow2BitmapTableLi

Re: [Qemu-block] [PATCH 3/4] util: Add VFIO helper library

2016-12-21 Thread Paolo Bonzini
On 21/12/2016 17:19, Fam Zheng wrote: > It's clever! It'd be a bit more complicated than that, though. Things like > queues etc in block/nvme.c have to be preserved, and if we already ensure > that, > ram blocks can be preserved similarly, but indeed bounce buffers can be > handled > that way.

Re: [Qemu-block] [PATCH v2] qemu-img: fix in-flight count for qemu-img bench

2016-12-21 Thread John Snow
On 12/07/2016 10:08 AM, Paolo Bonzini wrote: > With aio=native (qemu-img bench -n) one or more requests can be completed > when a new request is submitted. This in turn can cause bench_cb to > recurse before b->in_flight is updated. This causes multiple I/Os > to be submitted with the same offs

Re: [Qemu-block] [Qemu-devel] [PATCH] migration: re-active images when migration fails to complete

2016-12-21 Thread Hailiang Zhang
On 2016/12/9 4:02, Dr. David Alan Gilbert wrote: * Hailiang Zhang (zhang.zhanghaili...@huawei.com) wrote: Hi, On 2016/12/6 23:24, Dr. David Alan Gilbert wrote: * Kevin Wolf (kw...@redhat.com) wrote: Am 19.11.2016 um 12:43 hat zhanghailiang geschrieben: commit fe904ea8242cbae2d7e69c052c754b8f

Re: [Qemu-block] [PATCH v5 7/9] block: don't make snapshots for filters

2016-12-21 Thread Pavel Dovgalyuk
Kevin, > From: Kevin Wolf [mailto:kw...@redhat.com] > Am 05.12.2016 um 12:49 hat Pavel Dovgalyuk geschrieben: > > > From: Kevin Wolf [mailto:kw...@redhat.com] > > > > It's not a requirement. But to make replay deterministic we have to > > start with the same image every time. As I know, this may b