Offline manipulation of Dirty Bitmaps by qemu-img

2019-12-05 Thread John Snow
This has come up in the past, and I believe we discussed this at KVM Forum, too: There have been requests from oVirt (via Nir Soffer) to add some offline bitmap manipulation functionality. In the past, our stance has generally been "Use QEMU without an accelerator, and use QMP to manipulate the

Re: [PATCH for-4.2?] block/qcow2-bitmap: fix crash bug in qcow2_co_remove_persistent_dirty_bitmap

2019-12-05 Thread John Snow
On 12/5/19 4:53 PM, Eric Blake wrote: > On 12/5/19 2:16 PM, John Snow wrote: > Last minute edit: hmm, actually, transaction action introduced in 4.2, so crash is not a regression, only broken block-dirty-bitmap-remove command is a regression... Maybe it's OK for stable. >>>

Re: [PATCH for-4.2?] block/qcow2-bitmap: fix crash bug in qcow2_co_remove_persistent_dirty_bitmap

2019-12-05 Thread Eric Blake
On 12/5/19 2:16 PM, John Snow wrote: Last minute edit: hmm, actually, transaction action introduced in 4.2, so crash is not a regression, only broken block-dirty-bitmap-remove command is a regression... Maybe it's OK for stable. Libvirt REALLY wants to use transaction bitmap management (and

Re: [PATCH v2 6/7] configure: allow disable of cross compilation containers

2019-12-05 Thread Cleber Rosa
On Wed, Dec 04, 2019 at 04:46:17PM +0100, Thomas Huth wrote: > From: Alex Bennée > > Our docker infrastructure isn't quite as multiarch as we would wish so > let's allow the user to disable it if they want. This will allow us to > use still run check-tcg on non-x86 CI setups. > > Signed-off-by:

Re: [PATCH v2 5/7] tests/test-util-filemonitor: Skip test on non-x86 Travis containers

2019-12-05 Thread Cleber Rosa
On Wed, Dec 04, 2019 at 04:46:16PM +0100, Thomas Huth wrote: > test-util-filemonitor fails in restricted non-x86 Travis containers > since they apparently blacklisted some required system calls there. > Let's simply skip the test if we detect such an environment. > > Reviewed-by: Philippe

Re: [PATCH v2 4/7] tests/hd-geo-test: Skip test when images can not be created

2019-12-05 Thread Cleber Rosa
On Wed, Dec 04, 2019 at 04:46:15PM +0100, Thomas Huth wrote: > In certain environments like restricted containers, we can not create > huge test images. To be able to use "make check" in such container > environments, too, let's skip the hd-geo-test instead of failing when > the test images could

Re: [PATCH for-4.2?] block/qcow2-bitmap: fix crash bug in qcow2_co_remove_persistent_dirty_bitmap

2019-12-05 Thread John Snow
On 12/5/19 3:09 PM, Eric Blake wrote: > On 12/5/19 1:30 PM, Vladimir Sementsov-Ogievskiy wrote: >> Here is double bug: >> >> First, return error but not set errp. This may lead to: >> qmp block-dirty-bitmap-remove may report success when actually failed >> >> block-dirty-bitmap-remove used in a

Re: [PATCH for-4.2?] block/qcow2-bitmap: fix crash bug in qcow2_co_remove_persistent_dirty_bitmap

2019-12-05 Thread Eric Blake
On 12/5/19 1:30 PM, Vladimir Sementsov-Ogievskiy wrote: Here is double bug: First, return error but not set errp. This may lead to: qmp block-dirty-bitmap-remove may report success when actually failed block-dirty-bitmap-remove used in a transaction will crash, as qmp_transaction will think

Re: [PATCH v7 21/21] nbd: assert that Error** is not NULL in nbd_iter_channel_error

2019-12-05 Thread Eric Blake
On 12/5/19 12:09 PM, Vladimir Sementsov-Ogievskiy wrote: All callers of nbd_iter_channel_error() pass the address of a local_err variable, and only call this function if an error has already occurred, using this function to append details to that error. Hmm, not to append details but to

Re: [PATCH for-4.2?] block/qcow2-bitmap: fix crash bug in qcow2_co_remove_persistent_dirty_bitmap

2019-12-05 Thread John Snow
On 12/5/19 2:30 PM, Vladimir Sementsov-Ogievskiy wrote: > Here is double bug: > > First, return error but not set errp. This may lead to: > qmp block-dirty-bitmap-remove may report success when actually failed > > block-dirty-bitmap-remove used in a transaction will crash, as >

[PATCH for-4.2?] block/qcow2-bitmap: fix crash bug in qcow2_co_remove_persistent_dirty_bitmap

2019-12-05 Thread Vladimir Sementsov-Ogievskiy
Here is double bug: First, return error but not set errp. This may lead to: qmp block-dirty-bitmap-remove may report success when actually failed block-dirty-bitmap-remove used in a transaction will crash, as qmp_transaction will think that it returned success and will cal

Re: [PATCH v2 2/7] iotests: Skip test 060 if it is not possible to create large files

2019-12-05 Thread Cleber Rosa
On Wed, Dec 04, 2019 at 04:46:13PM +0100, Thomas Huth wrote: > Test 060 fails in the arm64, s390x and ppc64le LXD containers on Travis > (which we will hopefully enable in our CI soon). These containers > apparently do not allow large files to be created. The repair process > in test 060 creates a

Re: [libvirt] [PATCH v2 20/25] qemu: Implement backup job APIs and qemu handling

2019-12-05 Thread Eric Blake
[adding some qemu visibility] On 12/5/19 7:34 AM, Peter Krempa wrote: +if (!(mergebitmapsstore = virJSONValueCopy(mergebitmaps))) +return -1; + +if (qemuMonitorTransactionBitmapAdd(actions, +dd->domdisk->src->nodeformat, +

Re: [PATCH v7 21/21] nbd: assert that Error** is not NULL in nbd_iter_channel_error

2019-12-05 Thread Vladimir Sementsov-Ogievskiy
05.12.2019 20:49, Eric Blake wrote: > On 12/5/19 11:39 AM, Vladimir Sementsov-Ogievskiy wrote: >> 05.12.2019 20:14, Eric Blake wrote: >>> On 12/5/19 9:20 AM, Vladimir Sementsov-Ogievskiy wrote: The local_err parameter is not here to return information about nbd_iter_channel_error

Re: [PATCH v7 21/21] nbd: assert that Error** is not NULL in nbd_iter_channel_error

2019-12-05 Thread Eric Blake
On 12/5/19 11:39 AM, Vladimir Sementsov-Ogievskiy wrote: 05.12.2019 20:14, Eric Blake wrote: On 12/5/19 9:20 AM, Vladimir Sementsov-Ogievskiy wrote: The local_err parameter is not here to return information about nbd_iter_channel_error failure. Instead it's assumed to be filled when passed to

Re: [PATCH v8 21/21] nbd: assert that Error** is not NULL in nbd_iter_channel_error

2019-12-05 Thread Eric Blake
On 12/5/19 11:46 AM, Vladimir Sementsov-Ogievskiy wrote: The local_err parameter is not here to return information about nbd_iter_channel_error failure. Instead it's assumed to be filled when passed to the function. This is already stressed by its name (local_err, instead of classic errp).

[PATCH v8 00/21] error: prepare for auto propagated local_err

2019-12-05 Thread Vladimir Sementsov-Ogievskiy
Hi all! This is the first part of the bit series, which contains mostly simple cleanups. v6 was sent in separate (I'm sorry for inconvenience) v7: by Markus review (and with his prepared fixups, thanks a lot!): - don't rename Error** paramters - switch to Error *const * where appropriate

[PATCH v8 10/21] block/snapshot: rename Error ** parameter to more common errp

2019-12-05 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- include/block/snapshot.h | 2 +- block/snapshot.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/block/snapshot.h b/include/block/snapshot.h index b5d5084a12..2bfcd57578 100644 ---

[PATCH v8 21/21] nbd: assert that Error** is not NULL in nbd_iter_channel_error

2019-12-05 Thread Vladimir Sementsov-Ogievskiy
The local_err parameter is not here to return information about nbd_iter_channel_error failure. Instead it's assumed to be filled when passed to the function. This is already stressed by its name (local_err, instead of classic errp). Stress it additionally by assertion. Signed-off-by: Vladimir

Re: [PATCH v7 21/21] nbd: assert that Error** is not NULL in nbd_iter_channel_error

2019-12-05 Thread Vladimir Sementsov-Ogievskiy
05.12.2019 20:14, Eric Blake wrote: > On 12/5/19 9:20 AM, Vladimir Sementsov-Ogievskiy wrote: >> The local_err parameter is not here to return information about >> nbd_iter_channel_error failure. Instead it's assumed to be filled when >> passed to the function. This is already stressed by its name

Re: [RFC v5 024/126] error: auto propagated local_err

2019-12-05 Thread Eric Blake
On 12/5/19 8:58 AM, Vladimir Sementsov-Ogievskiy wrote: What about you provide the examples, and then I try to polish the prose? 1: error_fatal problem Assume the following code flow: int f1(errp) { ... ret = f2(errp); if (ret < 0) { error_append_hint(errp, "very

Re: [PATCH v7 21/21] nbd: assert that Error** is not NULL in nbd_iter_channel_error

2019-12-05 Thread Eric Blake
On 12/5/19 9:20 AM, Vladimir Sementsov-Ogievskiy wrote: The local_err parameter is not here to return information about nbd_iter_channel_error failure. Instead it's assumed to be filled when passed to the function. This is already stressed by its name (local_err, instead of classic errp). Stress

Re: [RFC v5 024/126] error: auto propagated local_err

2019-12-05 Thread Vladimir Sementsov-Ogievskiy
05.12.2019 17:58, Vladimir Sementsov-Ogievskiy wrote: > 05.12.2019 15:36, Markus Armbruster wrote: >> Vladimir Sementsov-Ogievskiy writes: >> >>> 04.12.2019 17:59, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: > Here is introduced ERRP_AUTO_PROPAGATE macro, to be

Re: [PATCH] qemu-img: fix info --backing-chain --image-opts

2019-12-05 Thread Eric Blake
On 12/5/19 7:46 AM, Stefan Hajnoczi wrote: Only apply --image-opts to the topmost image when listing an entire backing chain. It is incorrect to treat backing filenames as image options. Assuming we have the backing chain t.IMGFMT.base <- t.IMGFMT.mid <- t.IMGFMT, qemu-img info fails as

Re: [PATCH v7 00/21] error: prepare for auto propagated local_err

2019-12-05 Thread Vladimir Sementsov-Ogievskiy
05.12.2019 18:26, Cornelia Huck wrote: > On Thu, 5 Dec 2019 18:19:58 +0300 > Vladimir Sementsov-Ogievskiy wrote: > >> Hi all! >> >> This is the first part of the bit series, which contains mostly simple >> cleanups. > > What's the plan? Should subsystem maintainers pick up individual >

Re: [PATCH v7 00/21] error: prepare for auto propagated local_err

2019-12-05 Thread Cornelia Huck
On Thu, 5 Dec 2019 18:19:58 +0300 Vladimir Sementsov-Ogievskiy wrote: > Hi all! > > This is the first part of the bit series, which contains mostly simple > cleanups. What's the plan? Should subsystem maintainers pick up individual patches, or will they be merged in one go?

[PATCH v7 10/21] block/snapshot: rename Error ** parameter to more common errp

2019-12-05 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- include/block/snapshot.h | 2 +- block/snapshot.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/block/snapshot.h b/include/block/snapshot.h index b5d5084a12..2bfcd57578 100644 ---

[PATCH v7 21/21] nbd: assert that Error** is not NULL in nbd_iter_channel_error

2019-12-05 Thread Vladimir Sementsov-Ogievskiy
The local_err parameter is not here to return information about nbd_iter_channel_error failure. Instead it's assumed to be filled when passed to the function. This is already stressed by its name (local_err, instead of classic errp). Stress it additionally by assertion. Signed-off-by: Vladimir

[PATCH v7 00/21] error: prepare for auto propagated local_err

2019-12-05 Thread Vladimir Sementsov-Ogievskiy
Hi all! This is the first part of the bit series, which contains mostly simple cleanups. v6 was sent in separate (I'm sorry for inconvenience) v7: by Markus review (and with his prepared fixups, thanks a lot!): - don't rename Error** paramters - switch to Error *const * where appropriate

Re: [RFC v5 024/126] error: auto propagated local_err

2019-12-05 Thread Vladimir Sementsov-Ogievskiy
05.12.2019 15:36, Markus Armbruster wrote: > Vladimir Sementsov-Ogievskiy writes: > >> 04.12.2019 17:59, Markus Armbruster wrote: >>> Vladimir Sementsov-Ogievskiy writes: >>> Here is introduced ERRP_AUTO_PROPAGATE macro, to be used at start of functions with errp OUT parameter.

Re: [PATCH v5 1/2] block/nbd: extract the common cleanup code

2019-12-05 Thread Eric Blake
On 12/5/19 3:42 AM, Stefano Garzarella wrote: Hi Pan, On Thu, Dec 05, 2019 at 11:45:27AM +0800, pannengy...@huawei.com wrote: From: Pan Nengyuan The BDRVNBDState cleanup code is common in two places, add nbd_clear_bdrvstate() function to do these cleanups. Signed-off-by: Stefano Garzarella

[PATCH] qemu-img: fix info --backing-chain --image-opts

2019-12-05 Thread Stefan Hajnoczi
Only apply --image-opts to the topmost image when listing an entire backing chain. It is incorrect to treat backing filenames as image options. Assuming we have the backing chain t.IMGFMT.base <- t.IMGFMT.mid <- t.IMGFMT, qemu-img info fails as follows: $ qemu-img info --backing-chain

Re: [RFC v5 024/126] error: auto propagated local_err

2019-12-05 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > 04.12.2019 17:59, Markus Armbruster wrote: >> Vladimir Sementsov-Ogievskiy writes: >> >>> Here is introduced ERRP_AUTO_PROPAGATE macro, to be used at start of >>> functions with errp OUT parameter. >>> >>> It has three goals: >>> >>> 1. Fix issue with

Re: [PATCH v5 2/2] block/nbd: fix memory leak in nbd_open()

2019-12-05 Thread Stefano Garzarella
On Thu, Dec 05, 2019 at 11:45:28AM +0800, pannengy...@huawei.com wrote: > From: Pan Nengyuan > > In currently implementation there will be a memory leak when > nbd_client_connect() returns error status. Here is an easy way to > reproduce: > > 1. run qemu-iotests as follow and check the result

Re: [PATCH v5 1/2] block/nbd: extract the common cleanup code

2019-12-05 Thread Stefano Garzarella
Hi Pan, On Thu, Dec 05, 2019 at 11:45:27AM +0800, pannengy...@huawei.com wrote: > From: Pan Nengyuan > > The BDRVNBDState cleanup code is common in two places, add > nbd_clear_bdrvstate() function to do these cleanups. > > Signed-off-by: Stefano Garzarella I only suggested this change, so I

Re: [RFC v5 024/126] error: auto propagated local_err

2019-12-05 Thread Vladimir Sementsov-Ogievskiy
04.12.2019 17:59, Markus Armbruster wrote: > Vladimir Sementsov-Ogievskiy writes: > >> Here is introduced ERRP_AUTO_PROPAGATE macro, to be used at start of >> functions with errp OUT parameter. >> >> It has three goals: >> >> 1. Fix issue with error_fatal & error_prepend/error_append_hint: user