Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: Add test for failing qemu-img commit

2017-06-29 Thread Max Reitz
On 2017-06-27 21:52, Eric Blake wrote: > On 06/16/2017 08:58 AM, Max Reitz wrote: >> Signed-off-by: Max Reitz >> --- >> In order to pass, this depends on "fix: avoid an infinite loop or a >> dangling pointer problem in img_commit" >>

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

2017-06-29 Thread Max Reitz
Signed-off-by: Max Reitz --- v2: - Use test number which (I hope) no currently pending patch is trying to use [Kevin] - Write 42 bytes instead of 64 so it looks less like a mistake - Mark the test as quick (because it is) git-backport-diff output against v1: Key: [] :

Re: [Qemu-block] [PATCH v4 1/2] iotests: Use absolute paths for executables

2017-06-29 Thread Max Reitz
On 2017-06-29 20:52, Eric Blake wrote: > On 06/21/2017 08:30 AM, Max Reitz wrote: >> A user may specify a relative path for accessing qemu, qemu-img, etc. >> through environment variables ($QEMU_PROG and friends) or a symlink. >> >> If a test decides to change its working directory, relative paths

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

2017-06-29 Thread Max Reitz
On 2017-06-29 12:10, Kevin Wolf wrote: > Am 29.06.2017 um 01:23 hat Max Reitz geschrieben: >> 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

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

2017-06-29 Thread Max Reitz
On 2017-06-28 14:05, Vladimir Sementsov-Ogievskiy wrote: > Hi all! > > There is a new update of qcow2-bitmap series - v22. Thank you for all the work. After resolving some conflicts with the qcow2 LUKS series (and after bisecting some unrelated iotest 055 breakage), I've applied this series to

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

2017-06-29 Thread Max Reitz
On 2017-06-30 04:18, Eric Blake wrote: > On 06/28/2017 07:05 AM, Vladimir Sementsov-Ogievskiy wrote: >> Store persistent dirty bitmaps in qcow2 image. >> >> Signed-off-by: Vladimir Sementsov-Ogievskiy >> Reviewed-by: Max Reitz >> --- >>

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

2017-06-29 Thread Eric Blake
On 06/28/2017 07:05 AM, Vladimir Sementsov-Ogievskiy wrote: > Store persistent dirty bitmaps in qcow2 image. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > Reviewed-by: Max Reitz > --- > block/qcow2-bitmap.c | 475 >

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

2017-06-29 Thread Eric Blake
On 06/29/2017 08:55 PM, Eric Blake wrote: > On 06/28/2017 07:05 AM, Vladimir Sementsov-Ogievskiy wrote: >> Add bdrv_dirty_bitmap_deserialize_ones() function, which is needed for >> qcow2 bitmap loading, to handle unallocated bitmap parts, marked as >> all-ones. >> >> + * hbitmap_deserialize_ones

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

2017-06-29 Thread Eric Blake
On 06/28/2017 07:05 AM, Vladimir Sementsov-Ogievskiy wrote: > 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 >

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

2017-06-29 Thread Eric Blake
On 06/28/2017 07:05 AM, Vladimir Sementsov-Ogievskiy wrote: > 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

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

2017-06-29 Thread Eric Blake
On 06/28/2017 07:05 AM, Vladimir Sementsov-Ogievskiy wrote: > 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. > >

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

2017-06-29 Thread Max Reitz
On 2017-06-28 14:05, Vladimir Sementsov-Ogievskiy wrote: > 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

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

2017-06-29 Thread Eric Blake
On 06/29/2017 07:54 PM, John Snow wrote: >> Not necessarily an error, if it corresponds to a section that the guest >> has done a TRIM operation on, but where we did not have the means to >> punch a hole in the protocol layer. The semantics of guest TRIM is that >> the data can no longer be

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

2017-06-29 Thread John Snow
On 06/29/2017 08:45 PM, Eric Blake wrote: > On 06/29/2017 07:27 PM, 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 >>>

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

2017-06-29 Thread Eric Blake
On 06/29/2017 07:27 PM, 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

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

2017-06-29 Thread John Snow
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. > > Signed-off-by: Vladimir

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

2017-06-29 Thread Michael S. Tsirkin
On Wed, Jun 28, 2017 at 07:47:18PM +0100, 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

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

2017-06-29 Thread John Snow
On 06/29/2017 02:59 AM, Vladimir Sementsov-Ogievskiy wrote: > 29.06.2017 03:15, John Snow wrote: >> >> Alright, let me see if I have this straight... >> >> used-data: Normal data. We are standing on terra-firma. >> used-zero: Data that is defined to be zeroes in some way. >> >> (Does not

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

2017-06-29 Thread John Snow
On 06/28/2017 10:58 AM, Kashyap Chamarthy wrote: > 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

Re: [Qemu-block] [Qemu-devel] [RFC v1 4/4] util/oslib-win32: Recursivly pass the timeout

2017-06-29 Thread Alistair Francis
On Thu, Jun 29, 2017 at 12:47 PM, Paolo Bonzini wrote: >> On Thu, Jun 29, 2017 at 5:34 AM, Paolo Bonzini wrote: >> > On 28/06/2017 01:57, Alistair Francis wrote: >> > I'm not sure I agree with this change, which is effectively delaying the >> >

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

2017-06-29 Thread John Snow
On 06/28/2017 08:05 AM, Vladimir Sementsov-Ogievskiy wrote: > 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)

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

2017-06-29 Thread John Snow
On 06/29/2017 11:11 AM, Eric Blake wrote: > On 06/29/2017 03:28 AM, Vladimir Sementsov-Ogievskiy wrote: >> Hi! >> >> Can we apply my "[PATCH v22 00/30] qcow2: persistent dirty bitmaps" >> first? It was already near to the victory a week ago, but I had to >> rebase it on new Paolo's patches. > >

Re: [Qemu-block] [PATCH] block: fix bs->file leak in bdrv_new_open_driver()

2017-06-29 Thread Manos Pitsidianakis
On Thu, Jun 29, 2017 at 03:57:49PM +0200, Kevin Wolf wrote: Am 29.06.2017 um 14:07 hat Manos Pitsidianakis geschrieben: On Thu, Jun 29, 2017 at 01:18:24PM +0200, Kevin Wolf wrote: >Am 29.06.2017 um 08:03 hat Manos Pitsidianakis geschrieben: >>bdrv_open_driver() is called in two places,

Re: [Qemu-block] [RFC v1 4/4] util/oslib-win32: Recursivly pass the timeout

2017-06-29 Thread Paolo Bonzini
> On Thu, Jun 29, 2017 at 5:34 AM, Paolo Bonzini wrote: > > On 28/06/2017 01:57, Alistair Francis wrote: > > I'm not sure I agree with this change, which is effectively delaying the > > processing of events. The question to me is which handles are > > triggering so fast that

Re: [Qemu-block] [Qemu-devel] [PATCH 0/3] AHCI: re-privatize ahci headers

2017-06-29 Thread John Snow
On 06/23/2017 06:09 PM, John Snow wrote: > As reported by Philippe Mathieu-Daudé, including AHCI headers can > quickly pull in more dependencies than is sane. To remedy this, > split the AHCI headers into public and private areas as best as we > can and move the private information back into

Re: [Qemu-block] [PATCH v4 1/2] iotests: Use absolute paths for executables

2017-06-29 Thread Eric Blake
On 06/21/2017 08:30 AM, Max Reitz wrote: > A user may specify a relative path for accessing qemu, qemu-img, etc. > through environment variables ($QEMU_PROG and friends) or a symlink. > > If a test decides to change its working directory, relative paths will > cease to work, however. Work around

[Qemu-block] [PATCH v2 2/3] block: use defaults of bdrv_* callbacks in raw

2017-06-29 Thread Manos Pitsidianakis
Now that passing the call to bs->file is the default for some bdrv_* callbacks, remove the duplicate implementations in block/raw-format.c Signed-off-by: Manos Pitsidianakis --- block/raw-format.c | 32 +--- 1 file changed, 1 insertion(+), 31

[Qemu-block] [PATCH v2 1/3] block: pass bdrv_* methods to bs->file by default

2017-06-29 Thread Manos Pitsidianakis
The following functions fail if bs->drv does not implement them: bdrv_probe_blocksizes bdrv_probe_geometry bdrv_truncate bdrv_has_zero_init bdrv_get_info bdrv_media_changed bdrv_eject bdrv_lock_medium bdrv_co_ioctl Instead, the call should be passed to bs->file if it exists, to allow filter

[Qemu-block] [PATCH v2 3/3] block: add default implementations for bdrv_co_get_block_status()

2017-06-29 Thread Manos Pitsidianakis
bdrv_co_get_block_status_from_file() and bdrv_co_get_block_status_from_backing() set *file to bs->file and bs->backing respectively, so that bdrv_co_get_block_status() can recurse to them. Future block drivers won't have to duplicate code to implement this. Reviewed-by: Stefan Hajnoczi

[Qemu-block] [PATCH v2 0/3] block: block driver callbacks fixes

2017-06-29 Thread Manos Pitsidianakis
This series makes implementing some of the bdrv_* callbacks easier for block drivers by passing requests to bs->file if bs->drv doesn't implement it instead of failing, and adding default bdrv_co_get_block_status() implementations. This is based against Kevin Wolf's block branch, commit

Re: [Qemu-block] [PATCH v1 1/3] util/aio-win32: Only select on what we are actually waiting for

2017-06-29 Thread Philippe Mathieu-Daudé
On 06/29/2017 02:16 PM, Alistair Francis wrote: Signed-off-by: Alistair Francis Acked-by: Edgar E. Iglesias Reviewed-by: Philippe Mathieu-Daudé --- Changes since RFC: - Include more bitmasks for the select call

[Qemu-block] [PATCH v1 0/3] Windows runtime improvements

2017-06-29 Thread Alistair Francis
Changes since RFC: - Remove controversial timeout increate patch (util/oslib-win32: Recursivly pass the timeout) from the series - Small adjustments based on comments - Change from RFC to patch series Original cover letter: At Xilinx we have started to run our fork of QEMU on Windows and

[Qemu-block] [PATCH v1 2/3] util/oslib-win32: Remove invalid check

2017-06-29 Thread Alistair Francis
There is no way nhandles can be zero in this section so that part of the if statement will always be false. Let's just remove it to make the code easier to read. Signed-off-by: Alistair Francis Acked-by: Edgar E. Iglesias Reviewed-by:

[Qemu-block] [PATCH v1 3/3] util/oslib-win32: Remove if conditional

2017-06-29 Thread Alistair Francis
The original ready < nhandles - 1 can be re-written as ready + 1 < nhandles which is the same confition that we are checking on the first itteration of the for loop. This means we can remove the if statement and let the for loop check the code. This also has the side effect of removing an invalid

[Qemu-block] [PATCH v1 1/3] util/aio-win32: Only select on what we are actually waiting for

2017-06-29 Thread Alistair Francis
Signed-off-by: Alistair Francis Acked-by: Edgar E. Iglesias --- Changes since RFC: - Include more bitmasks for the select call util/aio-win32.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git

Re: [Qemu-block] [RFC v1 3/4] util/oslib-win32: Fix up if conditional

2017-06-29 Thread Alistair Francis
On Thu, Jun 29, 2017 at 5:25 AM, Paolo Bonzini wrote: > > > On 28/06/2017 01:57, Alistair Francis wrote: >> Signed-off-by: Alistair Francis >> Acked-by: Edgar E. Iglesias >> --- >> >> util/oslib-win32.c | 2 +- >> 1

Re: [Qemu-block] [RFC v1 4/4] util/oslib-win32: Recursivly pass the timeout

2017-06-29 Thread Alistair Francis
On Thu, Jun 29, 2017 at 5:34 AM, Paolo Bonzini wrote: > > > On 28/06/2017 01:57, Alistair Francis wrote: >> +/* We only found one and we are waiting on more then one. Let's try >> + * again. >> */ >> -if (timeout == 0 && nhandles > 1) { >> +

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] block: pass bdrv_* methods to bs->file by default

2017-06-29 Thread Eric Blake
On 06/29/2017 09:05 AM, Stefan Hajnoczi wrote: > On Wed, Jun 28, 2017 at 01:46:15AM +0300, Manos Pitsidianakis wrote: >> The following functions fail if bs->drv does not implement them: >> >> bdrv_probe_blocksizes >> bdrv_probe_geometry >> bdrv_truncate >> bdrv_has_zero_init >> bdrv_get_info >>

Re: [Qemu-block] [Qemu-devel] [PATCH 08/11] qed: introduce bdrv_qed_init_state

2017-06-29 Thread Eric Blake
On 06/29/2017 08:27 AM, Paolo Bonzini wrote: > This will be used in the next patch, which will call bdrv_qed_do_open > with a CoMutex taken. bdrv_qed_init_state provides a nice place to > initialize it. > > Signed-off-by: Paolo Bonzini > --- > RFC->v2: new > >

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

2017-06-29 Thread Eric Blake
On 06/29/2017 03:28 AM, Vladimir Sementsov-Ogievskiy wrote: > Hi! > > Can we apply my "[PATCH v22 00/30] qcow2: persistent dirty bitmaps" > first? It was already near to the victory a week ago, but I had to > rebase it on new Paolo's patches. Sure, I can rebase on top of yours (I've already

Re: [Qemu-block] [PATCH 1/2] block: pass bdrv_* methods to bs->file by default

2017-06-29 Thread Stefan Hajnoczi
On Wed, Jun 28, 2017 at 01:46:15AM +0300, Manos Pitsidianakis wrote: > @@ -3406,13 +3410,18 @@ int bdrv_truncate(BdrvChild *child, int64_t offset, > Error **errp) > > assert(child->perm & BLK_PERM_RESIZE); > > -if (!drv) { > -error_setg(errp, "No medium inserted"); > -

Re: [Qemu-block] [PATCH 1/2] block: pass bdrv_* methods to bs->file by default

2017-06-29 Thread Stefan Hajnoczi
On Wed, Jun 28, 2017 at 01:46:15AM +0300, Manos Pitsidianakis wrote: > The following functions fail if bs->drv does not implement them: > > bdrv_probe_blocksizes > bdrv_probe_geometry > bdrv_truncate > bdrv_has_zero_init > bdrv_get_info > bdrv_media_changed > bdrv_eject > bdrv_lock_medium >

Re: [Qemu-block] [PATCH 2/2] block: add default implementations for bdrv_co_get_block_status()

2017-06-29 Thread Stefan Hajnoczi
On Wed, Jun 28, 2017 at 01:46:16AM +0300, Manos Pitsidianakis wrote: > bdrv_co_get_block_status_from_file() and > bdrv_co_get_block_status_from_backing() set *file to bs->file and > bs->backing respectively, so that bdrv_co_get_block_status() can recurse > to them. Future block drivers won't have

Re: [Qemu-block] [PATCH] block: fix bs->file leak in bdrv_new_open_driver()

2017-06-29 Thread Kevin Wolf
Am 29.06.2017 um 14:07 hat Manos Pitsidianakis geschrieben: > On Thu, Jun 29, 2017 at 01:18:24PM +0200, Kevin Wolf wrote: > >Am 29.06.2017 um 08:03 hat Manos Pitsidianakis geschrieben: > >>bdrv_open_driver() is called in two places, bdrv_new_open_driver() and > >>bdrv_open_common(). In the latter,

Re: [Qemu-block] [Qemu-devel] [RFC v1 2/4] util/oslib-win32: Remove invalid check

2017-06-29 Thread Paolo Bonzini
On 28/06/2017 01:57, Alistair Francis wrote: > There is no way nhandles can be zero in this section so that part of the > if statement will always be false. Let's just remove it to make the code > easier to read. > > Signed-off-by: Alistair Francis > Acked-by: Edgar

[Qemu-block] [PATCH 09/11] qed: protect table cache with CoMutex

2017-06-29 Thread Paolo Bonzini
This makes the driver thread-safe. The CoMutex is dropped temporarily while accessing the data clusters or the backing file. Signed-off-by: Paolo Bonzini --- RFC->v2: add bdrv_qed_invalidate_cache change; invalidate_cache can run in a coroutine when

[Qemu-block] [PATCH 11/11] ssh: support I/O from any AioContext

2017-06-29 Thread Paolo Bonzini
The coroutine may run in a different AioContext, causing the fd handler to busy wait. Fix this by resetting the handler in restart_coroutine, before the coroutine is restarted. Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- block/ssh.c

[Qemu-block] [PATCH 10/11] sheepdog: add queue_lock

2017-06-29 Thread Paolo Bonzini
Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- block/sheepdog.c | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index 08d7b11e9d..a6013f0f17 100644 ---

[Qemu-block] [PATCH 04/11] vpc: make it thread-safe

2017-06-29 Thread Paolo Bonzini
Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- block/vpc.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/block/vpc.c b/block/vpc.c index

[Qemu-block] [PATCH 02/11] coroutine-lock: add qemu_co_rwlock_downgrade and qemu_co_rwlock_upgrade

2017-06-29 Thread Paolo Bonzini
These functions are more efficient in the presence of contention. qemu_co_rwlock_downgrade also guarantees not to block, which may be useful in some algorithms too. Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini

[Qemu-block] [PATCH 06/11] qed: move tail of qed_aio_write_main to qed_aio_write_{cow, alloc}

2017-06-29 Thread Paolo Bonzini
This part is never called for in-place writes, move it away to avoid the "backwards" coding style typical of callback-based code. Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- block/qed.c | 70

[Qemu-block] [PATCH 01/11] qcow2: call CoQueue APIs under CoMutex

2017-06-29 Thread Paolo Bonzini
Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- block/qcow2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 2f94f0326e..70d3f4a18e

[Qemu-block] [PATCH 07/11] block: invoke .bdrv_drain callback in coroutine context and from AioContext

2017-06-29 Thread Paolo Bonzini
This will let the callback take a CoMutex in the next patch. Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- block/io.c| 42 +- block/qed.c | 6 +++---

[Qemu-block] [PATCH 08/11] qed: introduce bdrv_qed_init_state

2017-06-29 Thread Paolo Bonzini
This will be used in the next patch, which will call bdrv_qed_do_open with a CoMutex taken. bdrv_qed_init_state provides a nice place to initialize it. Signed-off-by: Paolo Bonzini --- RFC->v2: new block/qed.c | 15 +++ 1 file changed, 11

[Qemu-block] [PATCH v2 00/11] Block layer thread-safety, part 2

2017-06-29 Thread Paolo Bonzini
This part takes care of drivers and devices, making sure that they can accept concurrent I/O from multiple AioContext. The following drivers are thread-safe without using any QemuMutex/CoMutex: crypto, gluster, null, rbd, win32-aio. NBD has already been fixed, because the patch fixed an

[Qemu-block] [PATCH 03/11] vdi: make it thread-safe

2017-06-29 Thread Paolo Bonzini
The VirtualBox driver is using a mutex to order all allocating writes, but it is not protecting accesses to the bitmap because they implicitly happen under the AioContext mutex. Change this to use a CoRwlock explicitly. Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi

Re: [Qemu-block] [PATCH v5 02/25] block: Use children list in bdrv_refresh_filename

2017-06-29 Thread Alberto Garcia
On Wed 21 Jun 2017 02:50:24 PM CEST, Max Reitz wrote: > bdrv_refresh_filename() should invoke itself recursively on all > children, not just on file. > > With that change, we can remove the manual invocations in blkverify, > quorum, commit, and mirror. > > Signed-off-by: Max Reitz

Re: [Qemu-block] [PATCH v5 01/25] block/mirror: Small absolute-paths simplification

2017-06-29 Thread Alberto Garcia
On Wed 21 Jun 2017 02:50:23 PM CEST, Max Reitz wrote: > When invoking drive-mirror in absolute-paths mode, the target's backing > BDS is assigned to it in mirror_exit(). The current logic only does so > if the target does not have that backing BDS already; but it actually > cannot have a backing

Re: [Qemu-block] [RFC v1 4/4] util/oslib-win32: Recursivly pass the timeout

2017-06-29 Thread Paolo Bonzini
On 28/06/2017 01:57, Alistair Francis wrote: > +/* We only found one and we are waiting on more then one. Let's try > + * again. > */ > -if (timeout == 0 && nhandles > 1) { > +if (nhandles > 1) { > /* Remove the handle that fired */ >

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

2017-06-29 Thread Alberto Garcia
On Wed 28 Jun 2017 04:58:00 PM CEST, Kashyap Chamarthy wrote: > +Once a 'mirror' job has started, there are two possible actions when a > +``drive-mirror`` job is active: > + > +1. Issuing the command ``block-job-cancel``: will, after completing > + synchronization of the content from the disk

Re: [Qemu-block] [RFC v1 3/4] util/oslib-win32: Fix up if conditional

2017-06-29 Thread Paolo Bonzini
On 28/06/2017 01:57, Alistair Francis wrote: > Signed-off-by: Alistair Francis > Acked-by: Edgar E. Iglesias > --- > > util/oslib-win32.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/util/oslib-win32.c

Re: [Qemu-block] [RFC v1 1/4] util/aio-win32: Only select on what we are actually waiting for

2017-06-29 Thread Paolo Bonzini
On 28/06/2017 01:57, Alistair Francis wrote: > Signed-off-by: Alistair Francis > Acked-by: Edgar E. Iglesias > --- > > util/aio-win32.c | 13 ++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git

Re: [Qemu-block] [PATCH] block: fix bs->file leak in bdrv_new_open_driver()

2017-06-29 Thread Manos Pitsidianakis
On Thu, Jun 29, 2017 at 01:18:24PM +0200, Kevin Wolf wrote: Am 29.06.2017 um 08:03 hat Manos Pitsidianakis geschrieben: bdrv_open_driver() is called in two places, bdrv_new_open_driver() and bdrv_open_common(). In the latter, failure cleanup in is in its caller, bdrv_open_inherit(), which

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

2017-06-29 Thread Alberto Garcia
On Wed 28 Jun 2017 10:33:49 PM CEST, Eric Blake wrote: >>> +Disk image backing chain notation >>> +- >> [...] >>> +.. important:: >>> +The base disk image can be raw format; however, all the overlay >>> +files must be of QCOW2 format. >> >> This is not

Re: [Qemu-block] [PATCH] block: fix bs->file leak in bdrv_new_open_driver()

2017-06-29 Thread Kevin Wolf
Am 29.06.2017 um 08:03 hat Manos Pitsidianakis geschrieben: > bdrv_open_driver() is called in two places, bdrv_new_open_driver() and > bdrv_open_common(). In the latter, failure cleanup in is in its caller, > bdrv_open_inherit(), which unrefs the bs->file of the failed driver open > if it exists.

[Qemu-block] [PATCH V2 4/8] qemu-img: add documentation for compress settings

2017-06-29 Thread Peter Lieven
Signed-off-by: Peter Lieven --- qemu-img.texi | 21 + 1 file changed, 21 insertions(+) diff --git a/qemu-img.texi b/qemu-img.texi index 5b925ec..430f0b9 100644 --- a/qemu-img.texi +++ b/qemu-img.texi @@ -621,6 +621,27 @@ file which is COW and has data blocks

[Qemu-block] [PATCH V2 6/8] block/qcow2: optimize qcow2_co_pwritev_compressed

2017-06-29 Thread Peter Lieven
if we specify exactly one iov of s->cluster_size bytes we can avoid the bounce buffer. Signed-off-by: Peter Lieven --- block/qcow2.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 39a8afc..0a7202a 100644 ---

[Qemu-block] [PATCH V2 5/8] block/qcow2: read and write the compress format extension

2017-06-29 Thread Peter Lieven
we now read the extension on open and write it on update, but do not yet use it. Signed-off-by: Peter Lieven --- block/qcow2.c | 100 ++ block/qcow2.h | 23 +++--- 2 files changed, 104 insertions(+), 19 deletions(-)

[Qemu-block] [PATCH V2 7/8] block/qcow2: start using the compress format extension

2017-06-29 Thread Peter Lieven
we now pass the parameters to the zlib compressor if the extension is present and use the old default values if the extension is absent. Signed-off-by: Peter Lieven --- block/qcow2-cluster.c | 58 ++- block/qcow2.c | 57

[Qemu-block] [PATCH V2 0/8] add Qcow2 compress format extension

2017-06-29 Thread Peter Lieven
this adds a create option for Qcow2 images to specify the compression format and level for compressed clusters. The series adds 2 algorithms to choose from: zlib and lzo. zlib is the current default, but with unoptimal settings. If no compress.format option is specified the old zlib with the old

[Qemu-block] [PATCH V2 3/8] block/qcow2: parse compress create options

2017-06-29 Thread Peter Lieven
this adds parsing and validation for the compress create options. They are only validated but not yet used. Signed-off-by: Peter Lieven --- block/qcow2.c | 56 +-- block/qcow2.h | 9

[Qemu-block] [PATCH V2 8/8] block/qcow2: add lzo compress format

2017-06-29 Thread Peter Lieven
Signed-off-by: Peter Lieven --- block/qcow2-cluster.c | 15 +++ block/qcow2.c | 26 +- block/qcow2.h | 1 + configure | 2 +- qapi/block-core.json | 14 -- qemu-img.texi | 1 + 6 files changed,

[Qemu-block] [PATCH V2 1/8] docs: add compress format extension to qcow2 spec

2017-06-29 Thread Peter Lieven
Signed-off-by: Peter Lieven --- docs/interop/qcow2.txt | 43 ++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/docs/interop/qcow2.txt b/docs/interop/qcow2.txt index 80cdfd0..c01daf3 100644 --- a/docs/interop/qcow2.txt +++

[Qemu-block] [PATCH V2 2/8] qapi: add compress parameters to Qcow2 Blockdev options

2017-06-29 Thread Peter Lieven
Signed-off-by: Peter Lieven --- qapi/block-core.json | 44 +++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index f85c223..1574ffb 100644 --- a/qapi/block-core.json +++

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

2017-06-29 Thread Kevin Wolf
Am 29.06.2017 um 01:23 hat Max Reitz geschrieben: > 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

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

2017-06-29 Thread Kevin Wolf
Am 28.06.2017 um 21:38 hat Eric Blake geschrieben: > 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

Re: [Qemu-block] [RFC v1 4/4] util/oslib-win32: Recursivly pass the timeout

2017-06-29 Thread Fam Zheng
On Tue, 06/27 16:57, Alistair Francis wrote: > Signed-off-by: Alistair Francis > Acked-by: Edgar E. Iglesias > --- > > util/oslib-win32.c | 21 + > 1 file changed, 17 insertions(+), 4 deletions(-) > > diff --git

Re: [Qemu-block] [RFC v1 3/4] util/oslib-win32: Fix up if conditional

2017-06-29 Thread Fam Zheng
On Tue, 06/27 16:57, Alistair Francis wrote: > Signed-off-by: Alistair Francis > Acked-by: Edgar E. Iglesias > --- > > util/oslib-win32.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/util/oslib-win32.c

Re: [Qemu-block] [RFC v1 2/4] util/oslib-win32: Remove invalid check

2017-06-29 Thread Fam Zheng
On Tue, 06/27 16:57, Alistair Francis wrote: > There is no way nhandles can be zero in this section so that part of the > if statement will always be false. Let's just remove it to make the code > easier to read. > > Signed-off-by: Alistair Francis > Acked-by: Edgar

[Qemu-block] [PATCH v7 8/8] vmdk: Make vmdk_get_cluster_offset() return cluster offset only

2017-06-29 Thread Ashijeet Acharya
vmdk_alloc_clusters() introduced earlier now handles the task of allocating clusters and performing COW when needed. Thus we can change vmdk_get_cluster_offset() to stick to the sole purpose of returning cluster offset using sector number. Update the changes at all call sites. Signed-off-by:

[Qemu-block] [PATCH v7 7/8] vmdk: Update metadata for multiple clusters

2017-06-29 Thread Ashijeet Acharya
Include a next pointer in VmdkMetaData struct to point to the previous allocated L2 table. Modify vmdk_L2update to start updating metadata for allocation of multiple clusters at once. Signed-off-by: Ashijeet Acharya --- block/vmdk.c | 128

[Qemu-block] [PATCH v7 6/8] vmdk: New functions to assist allocating multiple clusters

2017-06-29 Thread Ashijeet Acharya
Introduce two new helper functions handle_alloc() and vmdk_alloc_cluster_offset(). handle_alloc() helps to allocate multiple clusters at once starting from a given offset on disk and performs COW if necessary for first and last allocated clusters. vmdk_alloc_cluster_offset() helps to return the

[Qemu-block] [PATCH v7 5/8] vmdk: Set maximum bytes allocated in one cycle

2017-06-29 Thread Ashijeet Acharya
Set the maximum bytes allowed to get allocated at once to be not more than the extent size boundary to handle writes at two separate extents appropriately. Signed-off-by: Ashijeet Acharya Reviewed-by: Fam Zheng --- block/vmdk.c | 13 +++-- 1

[Qemu-block] [PATCH v7 3/8] vmdk: Rename get_cluster_offset() to vmdk_get_cluster_offset()

2017-06-29 Thread Ashijeet Acharya
Rename the existing get_cluster_offset() to vmdk_get_cluster_offset() and update name in all the callers accordingly. Signed-off-by: Ashijeet Acharya Reviewed-by: Fam Zheng --- block/vmdk.c | 46 +++--- 1 file

[Qemu-block] [PATCH v7 2/8] vmdk: Rename get_whole_cluster() to vmdk_perform_cow()

2017-06-29 Thread Ashijeet Acharya
Rename the existing function get_whole_cluster() to vmdk_perform_cow() as its sole purpose is to perform COW for the first and the last allocated clusters if needed. Signed-off-by: Ashijeet Acharya Reviewed-by: Fam Zheng --- block/vmdk.c | 23

[Qemu-block] [PATCH v7 1/8] vmdk: Move vmdk_find_offset_in_cluster() to the top

2017-06-29 Thread Ashijeet Acharya
Move the existing vmdk_find_offset_in_cluster() function to the top of the driver. Signed-off-by: Ashijeet Acharya Reviewed-by: Fam Zheng --- block/vmdk.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git

[Qemu-block] [PATCH v7 4/8] vmdk: Factor out metadata loading code out of vmdk_get_cluster_offset()

2017-06-29 Thread Ashijeet Acharya
Move the cluster tables loading code out of the existing vmdk_get_cluster_offset() function and implement it in separate get_cluster_table() and vmdk_l2load() functions. Signed-off-by: Ashijeet Acharya Reviewed-by: Fam Zheng --- block/vmdk.c | 153

[Qemu-block] [PATCH v7 0/8] Optimize VMDK I/O by allocating multiple clusters

2017-06-29 Thread Ashijeet Acharya
Previously posted series patches: v1 - http://lists.nongnu.org/archive/html/qemu-devel/2017-03/msg02044.html v2 - http://lists.nongnu.org/archive/html/qemu-devel/2017-03/msg05080.html v3 - http://lists.nongnu.org/archive/html/qemu-devel/2017-04/msg00074.html v4 -

Re: [Qemu-block] [RFC v1 1/4] util/aio-win32: Only select on what we are actually waiting for

2017-06-29 Thread Fam Zheng
On Tue, 06/27 16:57, Alistair Francis wrote: > Signed-off-by: Alistair Francis > Acked-by: Edgar E. Iglesias > --- > > util/aio-win32.c | 13 ++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git

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

2017-06-29 Thread Fam Zheng
On Wed, 06/28 19:47, Stefan Hajnoczi wrote: > 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

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

2017-06-29 Thread Fam Zheng
On Wed, 06/28 19:47, Stefan Hajnoczi wrote: > Use the new used ring APIs instead of assuming ISR being set means the > request has completed. > > Signed-off-by: Stefan Hajnoczi Reviewed-by: Fam Zheng

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

2017-06-29 Thread Fam Zheng
On Wed, 06/28 19:47, Stefan Hajnoczi wrote: > Use the new used ring APIs instead of assuming ISR being set means the > request has completed. > > Signed-off-by: Stefan Hajnoczi Reviewed-by: Fam Zheng

Re: [Qemu-block] [PATCH v6 7/8] vmdk: Update metadata for multiple clusters

2017-06-29 Thread Ashijeet Acharya
On Tue, Jun 27, 2017 at 1:34 PM, Fam Zheng wrote: > On Mon, 06/05 13:22, Ashijeet Acharya wrote: >> @@ -1876,6 +1942,13 @@ static int vmdk_pwritev(BlockDriverState *bs, >> uint64_t offset, >> offset += n_bytes; >> bytes_done += n_bytes; >> >> +while

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

2017-06-29 Thread Markus Armbruster
John Snow writes: > 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

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

2017-06-29 Thread Vladimir Sementsov-Ogievskiy
29.06.2017 03:15, John Snow wrote: 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

[Qemu-block] [PATCH] block: fix bs->file leak in bdrv_new_open_driver()

2017-06-29 Thread Manos Pitsidianakis
bdrv_open_driver() is called in two places, bdrv_new_open_driver() and bdrv_open_common(). In the latter, failure cleanup in is in its caller, bdrv_open_inherit(), which unrefs the bs->file of the failed driver open if it exists. Let's check for this in bdrv_new_open_driver() as well.