Re: [Qemu-block] [Qemu-devel] [PATCH v4 5/8] block/mirror: fix and improve do_sync_target_write

2018-09-17 Thread John Snow
On 09/17/2018 10:57 AM, Vladimir Sementsov-Ogievskiy wrote: > Use bdrv_dirty_bitmap_next_dirty_area() instead of > bdrv_dirty_iter_next_area(), because of the following problems of > bdrv_dirty_iter_next_area(): > > 1. Using HBitmap iterators we should carefully handle unaligned offset, > as fi

Re: [Qemu-block] [Qemu-devel] [PATCH v4 3/8] dirty-bitmap: add bdrv_dirty_bitmap_next_dirty_area

2018-09-17 Thread John Snow
On 09/17/2018 10:57 AM, Vladimir Sementsov-Ogievskiy wrote: > The function alters bdrv_dirty_iter_next_area(), which is wrong and > less efficient (see further commit > "block/mirror: fix and improve do_sync_target_write" for description). > > Signed-off-by: Vladimir Sementsov-Ogievskiy > ---

Re: [Qemu-block] [Qemu-devel] [PATCH 4/6] dirty-bitmaps: clean-up bitmaps loading and migration logic

2018-09-17 Thread John Snow
On 09/17/2018 11:51 AM, Vladimir Sementsov-Ogievskiy wrote: > Hmm, ping, anybody here ?) > Was preparing to stage on Friday, working on it now. I never understood why you forbid the transfer of read only bitmaps though, can you point that out for me? --js

Re: [Qemu-block] [PATCH v2 11/17] block-backend: Decrease in_flight only after callback

2018-09-17 Thread Paolo Bonzini
On 17/09/2018 18:51, Kevin Wolf wrote: > Am 17.09.2018 um 17:59 hat Paolo Bonzini geschrieben: >> On 17/09/2018 14:53, Kevin Wolf wrote: > I think I can drop the ref/unref pair, but not the whole patch (whose > main point is reordering dec_in_flight vs. the AIO callback). You're r

Re: [Qemu-block] [PATCH v2 11/17] block-backend: Decrease in_flight only after callback

2018-09-17 Thread Kevin Wolf
Am 17.09.2018 um 17:59 hat Paolo Bonzini geschrieben: > On 17/09/2018 14:53, Kevin Wolf wrote: > >>> I think I can drop the ref/unref pair, but not the whole patch (whose > >>> main point is reordering dec_in_flight vs. the AIO callback). > >> > >> You're right, though I think I did that on purpose

Re: [Qemu-block] [PATCH 2/2] nbd/server: send more than one extent of base:allocation context

2018-09-17 Thread Vladimir Sementsov-Ogievskiy
05.07.2018 19:18, Vladimir Sementsov-Ogievskiy wrote: 05.07.2018 18:59, Eric Blake wrote: On 07/04/2018 06:23 AM, Vladimir Sementsov-Ogievskiy wrote: This is necessary for efficient block-status export, for clients which support it. qemu as client doesn't currently process additional informat

Re: [Qemu-block] [PATCH v2 11/17] block-backend: Decrease in_flight only after callback

2018-09-17 Thread Paolo Bonzini
On 17/09/2018 14:53, Kevin Wolf wrote: >>> I think I can drop the ref/unref pair, but not the whole patch (whose >>> main point is reordering dec_in_flight vs. the AIO callback). >> >> You're right, though I think I did that on purpose back in the day. >> IIRC it was related to bdrv_drain, which mi

Re: [Qemu-block] [Qemu-devel] [PATCH 4/6] dirty-bitmaps: clean-up bitmaps loading and migration logic

2018-09-17 Thread Vladimir Sementsov-Ogievskiy
Hmm, ping, anybody here ?) 02.08.2018 22:10, John Snow wrote: On 08/02/2018 03:05 PM, Denis V. Lunev wrote: On 08/02/2018 12:50 PM, Dr. David Alan Gilbert wrote: * Denis V. Lunev (d...@openvz.org) wrote: I don't quite understand the last two paragraphs. we are thinking right now to elimin

Re: [Qemu-block] [PATCH 0/7] qcow2: async handling of fragmented io

2018-09-17 Thread Vladimir Sementsov-Ogievskiy
ping. Finally, what about this? 07.08.2018 20:43, Vladimir Sementsov-Ogievskiy wrote: Hi all! Here is an asynchronous scheme for handling fragmented qcow2 reads and writes. Both qcow2 read and write functions loops through sequential portions of data. The series aim it to parallelize these loop

Re: [Qemu-block] [PATCH v4 00/10] NBD reconnect

2018-09-17 Thread Vladimir Sementsov-Ogievskiy
ping 31.07.2018 20:30, Vladimir Sementsov-Ogievskiy wrote: Hi all. Here is NBD reconnect. Previously, if connection failed all current and future requests will fail. After the series, nbd-client driver will try to reconnect unlimited times. During first @reconnect-delay seconds of reconnecting

[Qemu-block] [PATCH v4 4/8] tests: add tests for hbitmap_next_dirty_area

2018-09-17 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/test-hbitmap.c | 107 +++ 1 file changed, 107 insertions(+) diff --git a/tests/test-hbitmap.c b/tests/test-hbitmap.c index c0da31a6bd..4f312e9da3 100644 --- a/tests/test-hbitmap.c +++ b/tests/test-hbitm

[Qemu-block] [PATCH v4 0/8] dirty-bitmap: rewrite bdrv_dirty_iter_next_area

2018-09-17 Thread Vladimir Sementsov-Ogievskiy
Hi all. 1. bdrv_dirty_iter_next_area don't use hbitmap_next_zero and uses inefficient loop instead. Let's improve it. 2. bdrv_dirty_iter_next_area don't handle unaligned offset and max_offset correctly. I'm not sure that it is a real bug. But if it is, we need these series in 3.0. Details are in

[Qemu-block] [PATCH v4 8/8] Revert "hbitmap: Add @advance param to hbitmap_iter_next()"

2018-09-17 Thread Vladimir Sementsov-Ogievskiy
This reverts commit a33fbb4f8b64226becf502a123733776ce319b24. The functionality is unused. Note: in addition to automatic revert, drop second parameter in hbitmap_iter_next() call from hbitmap_next_dirty_area() too. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow --- includ

[Qemu-block] [PATCH v4 1/8] dirty-bitmap: improve bdrv_dirty_bitmap_next_zero

2018-09-17 Thread Vladimir Sementsov-Ogievskiy
Add bytes parameter to the function, to limit searched range. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/dirty-bitmap.h | 3 ++- include/qemu/hbitmap.h | 10 +++--- block/backup.c | 3 ++- block/dirty-bitmap.c | 5 +++-- nbd/server.c

[Qemu-block] [PATCH v4 3/8] dirty-bitmap: add bdrv_dirty_bitmap_next_dirty_area

2018-09-17 Thread Vladimir Sementsov-Ogievskiy
The function alters bdrv_dirty_iter_next_area(), which is wrong and less efficient (see further commit "block/mirror: fix and improve do_sync_target_write" for description). Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/dirty-bitmap.h | 2 ++ include/qemu/hbitmap.h | 16 ++

[Qemu-block] [PATCH v4 7/8] Revert "test-hbitmap: Add non-advancing iter_next tests"

2018-09-17 Thread Vladimir Sementsov-Ogievskiy
This reverts commit 269576848ec3d57d2d958cf5ac69b08c44adf816. The functionality is unused. Drop tests. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow --- tests/test-hbitmap.c | 36 1 file changed, 12 insertions(+), 24 deletions(-) diff

[Qemu-block] [PATCH v4 6/8] Revert "block/dirty-bitmap: Add bdrv_dirty_iter_next_area"

2018-09-17 Thread Vladimir Sementsov-Ogievskiy
This reverts commit 72d10a94213a954ad569095cb4491f2ae0853c40. The function is unused now. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow --- include/block/dirty-bitmap.h | 2 -- block/dirty-bitmap.c | 55 2 files changed, 57 del

[Qemu-block] [PATCH v4 5/8] block/mirror: fix and improve do_sync_target_write

2018-09-17 Thread Vladimir Sementsov-Ogievskiy
Use bdrv_dirty_bitmap_next_dirty_area() instead of bdrv_dirty_iter_next_area(), because of the following problems of bdrv_dirty_iter_next_area(): 1. Using HBitmap iterators we should carefully handle unaligned offset, as first call to hbitmap_iter_next() may return a value less than original offse

[Qemu-block] [PATCH v4 2/8] tests: add tests for hbitmap_next_zero with specified end parameter

2018-09-17 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/test-hbitmap.c | 32 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/tests/test-hbitmap.c b/tests/test-hbitmap.c index b04a45a2de..c0da31a6bd 100644 --- a/tests/test-hbitmap.c +++ b/tests/test-hb

Re: [Qemu-block] [PATCH v2 11/17] block-backend: Decrease in_flight only after callback

2018-09-17 Thread Kevin Wolf
Am 17.09.2018 um 14:38 hat Paolo Bonzini geschrieben: > On 17/09/2018 13:48, Kevin Wolf wrote: > > Am 14.09.2018 um 19:38 hat Paolo Bonzini geschrieben: > >> On 14/09/2018 19:14, Kevin Wolf wrote: > As you mention, you could have a nested aio_poll() in the main thread, > for example invok

Re: [Qemu-block] [PATCH v2 11/17] block-backend: Decrease in_flight only after callback

2018-09-17 Thread Paolo Bonzini
On 17/09/2018 13:48, Kevin Wolf wrote: > Am 14.09.2018 um 19:38 hat Paolo Bonzini geschrieben: >> On 14/09/2018 19:14, Kevin Wolf wrote: As you mention, you could have a nested aio_poll() in the main thread, for example invoked from a bottom half, but in that case I'd rather track th

Re: [Qemu-block] [PATCH v2 11/17] block-backend: Decrease in_flight only after callback

2018-09-17 Thread Kevin Wolf
Am 14.09.2018 um 19:38 hat Paolo Bonzini geschrieben: > On 14/09/2018 19:14, Kevin Wolf wrote: > >> As you mention, you could have a nested aio_poll() in the main thread, > >> for example invoked from a bottom half, but in that case I'd rather > >> track the caller that is creating the bottom half

Re: [Qemu-block] [PATCH v2 12/17] mirror: Fix potential use-after-free in active commit

2018-09-17 Thread Kevin Wolf
Am 17.09.2018 um 00:05 hat Max Reitz geschrieben: > On 14.09.18 18:25, Kevin Wolf wrote: > > Am 13.09.2018 um 22:55 hat Max Reitz geschrieben: > >> On 13.09.18 14:52, Kevin Wolf wrote: > >>> When starting an active commit job, other callbacks can run before > >>> mirror_start_job() calls bdrv_ref()

Re: [Qemu-block] [Qemu-devel] [RFC PATCH] scsi-block: Deprecate rotation_rate

2018-09-17 Thread Fam Zheng
On Mon, 09/17 10:55, Thomas Huth wrote: > On 2018-09-17 10:31, Fam Zheng wrote: > > This option is added together with scsi-disk but is never honoured, > > becuase we don't emulate the VPD page for scsi-block. We could intercept > > and inject the user specified value like for max xfer len, but it'

Re: [Qemu-block] [Qemu-devel] [RFC PATCH] scsi-block: Deprecate rotation_rate

2018-09-17 Thread Thomas Huth
On 2018-09-17 10:31, Fam Zheng wrote: > This option is added together with scsi-disk but is never honoured, > becuase we don't emulate the VPD page for scsi-block. We could intercept > and inject the user specified value like for max xfer len, but it's > probably not helpful since the intent of 070