Re: [PATCH v5 3/9] block-backend: Add flags to blk_truncate()

2020-04-23 Thread Max Reitz
| 2 +- > qemu-img.c | 2 +- > qemu-io-cmds.c | 2 +- > 15 files changed, 22 insertions(+), 21 deletions(-) Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

Re: [PATCH v5 2/9] block: Add flags to bdrv(_co)_truncate()

2020-04-23 Thread Max Reitz
othread.c | 6 +++--- > 13 files changed, 34 insertions(+), 28 deletions(-) Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

Re: [PATCH v5 1/9] block: Add flags to BlockDriver.bdrv_co_truncate()

2020-04-23 Thread Max Reitz
ons(-) (I know I haven’t complained before, so *shrug*, but I wonder now whether it actually makes sense to have the same BdrvRequestFlags for all request types. Or why we have the same flags type for read, write, and zero-write already.) Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

Re: [PATCH v4 30/30] iotests: Add tests for qcow2 images with extended L2 entries

2020-04-14 Thread Max Reitz
On 13.04.20 19:16, Alberto Garcia wrote: > On Thu 09 Apr 2020 02:22:37 PM CEST, Max Reitz wrote: >>> +### Write subcluster #31-#34 (cluster overlap) ### >> >> #31-#34, I think. > > That's what I wrote :-? Er #31-#33. >>> +### Parti

Re: [PATCH v4 20/30] qcow2: Add subcluster support to discard_in_l2_slice()

2020-04-14 Thread Max Reitz
On 10.04.20 14:47, Alberto Garcia wrote: > On Thu 09 Apr 2020 12:05:12 PM CEST, Max Reitz wrote: >>> switch (qcow2_get_cluster_type(bs, old_l2_entry)) { >>> case QCOW2_CLUSTER_UNALLOCATED: >>> -if (full_discard || !bs->backing) {

Re: qcow2: Zero-initialization of external data files

2020-04-09 Thread Max Reitz
On 09.04.20 16:32, Eric Blake wrote: > On 4/9/20 9:10 AM, Max Reitz wrote: > >>> >>> What happens when an operation attempts to unmap things?  Do we reject >>> all unmap operations when data-file-raw is set (thus leaving a cluster >>> marked as allocat

Re: qcow2: Zero-initialization of external data files

2020-04-09 Thread Max Reitz
On 09.04.20 15:47, Eric Blake wrote: > On 4/9/20 8:42 AM, Eric Blake wrote: > I'd argue that requiring the user to pre-zero the raw data file is undesirable; and that we should instead fix our code to not report the image as reading all zeroes when creating with data_file_raw=on.

Re: qcow2: Zero-initialization of external data files

2020-04-09 Thread Max Reitz
On 07.04.20 00:22, Eric Blake wrote: > On 2/17/20 10:56 AM, Max Reitz wrote: >> Hi, >> >> AFAIU, external data files with data_file_raw=on are supposed to return >> the same data as the qcow2 file when read.  But we still use the qcow2 >> metadata structures

Re: [PATCH v4 30/30] iotests: Add tests for qcow2 images with extended L2 entries

2020-04-09 Thread Max Reitz
On 17.03.20 19:16, Alberto Garcia wrote: > Signed-off-by: Alberto Garcia > --- > tests/qemu-iotests/271 | 359 + > tests/qemu-iotests/271.out | 244 + > tests/qemu-iotests/group | 1 + > 3 files changed, 604 insertions(+) >

Re: [PATCH v4 27/30] qcow2: Assert that expand_zero_clusters_in_l1() does not support subclusters

2020-04-09 Thread Max Reitz
On 17.03.20 19:16, Alberto Garcia wrote: > This function is only used by qcow2_expand_zero_clusters() to > downgrade a qcow2 image to a previous version. It is however not > possible to downgrade an image with extended L2 entries because older > versions of qcow2 do not have this feature. > >

Re: [PATCH v4 20/30] qcow2: Add subcluster support to discard_in_l2_slice()

2020-04-09 Thread Max Reitz
On 17.03.20 19:16, Alberto Garcia wrote: > Two changes are needed in this function: > > 1) A full discard deallocates a cluster so we can skip the operation if >it is already unallocated. With extended L2 entries however if any >of the subclusters has the 'all zeroes' bit set then we have

Re: [PATCH v4 13/30] qcow2: Add QCow2SubclusterType and qcow2_get_subcluster_type()

2020-04-09 Thread Max Reitz
On 08.04.20 19:46, Alberto Garcia wrote: > On Wed 08 Apr 2020 01:23:42 PM CEST, Max Reitz wrote: >>> +switch (type) { >>> +case QCOW2_CLUSTER_COMPRESSED: >>> +return QCOW2_SUBCLUSTER_COMPRESSED; >> >> Why did you drop the che

Re: [PATCH v4 18/30] qcow2: Add subcluster support to qcow2_get_host_offset()

2020-04-08 Thread Max Reitz
subclusters. > > Signed-off-by: Alberto Garcia > --- > block/qcow2.h | 38 +-- > block/qcow2-cluster.c | 143 +- > 2 files changed, 85 insertions(+), 96 deletions(-) Reviewed-by: Max Reitz (Oops, totally missed the L1 entry

Re: [PATCH v4 15/30] qcow2: Replace QCOW2_CLUSTER_* with QCOW2_SUBCLUSTER_*

2020-04-08 Thread Max Reitz
lock/qcow2-cluster.c | 10 +++ > block/qcow2.c | 70 ++- > 3 files changed, 42 insertions(+), 40 deletions(-) Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

Re: [PATCH v4 14/30] qcow2: Add cluster type parameter to qcow2_get_host_offset()

2020-04-08 Thread Max Reitz
f-by: Alberto Garcia > --- > block/qcow2.h | 3 ++- > block/qcow2-cluster.c | 11 +++ > block/qcow2.c | 37 ++--- > 3 files changed, 31 insertions(+), 20 deletions(-) Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

Re: [PATCH v4 13/30] qcow2: Add QCow2SubclusterType and qcow2_get_subcluster_type()

2020-04-08 Thread Max Reitz
On 17.03.20 19:16, Alberto Garcia wrote: > This patch adds QCow2SubclusterType, which is the subcluster-level > version of QCow2ClusterType. All QCOW2_SUBCLUSTER_* values have the > the same meaning as their QCOW2_CLUSTER_* equivalents (when they > exist). See below for details and caveats. > >

Re: [PATCH v4 09/30] qcow2: Add subcluster-related fields to BDRVQcow2State

2020-04-08 Thread Max Reitz
;< subcluster_bits = subcluster_size > > Images without subclusters are treated as if they had exactly one, > with subcluster_size = cluster_size. > > Signed-off-by: Alberto Garcia > --- > block/qcow2.h | 5 + > block/qcow2.c | 5 + > 2 files changed, 10 inserti

Re: [PATCH v4 07/30] qcow2: Document the Extended L2 Entries feature

2020-04-08 Thread Max Reitz
format and how they > affect the calculation of the L2 cache size. > > Signed-off-by: Alberto Garcia > --- > docs/interop/qcow2.txt | 68 -- > docs/qcow2-cache.txt | 19 +++- > 2 files changed, 83 insertions(+), 4 deletions(-) Revi

Re: [PATCH v4 02/30] qcow2: Convert qcow2_get_cluster_offset() into qcow2_get_host_offset()

2020-04-08 Thread Max Reitz
On 17.03.20 19:15, Alberto Garcia wrote: > qcow2_get_cluster_offset() takes an (unaligned) guest offset and > returns the (aligned) offset of the corresponding cluster in the qcow2 > image. > > In practice none of the callers need to know where the cluster starts > so this patch makes the

Re: [PATCH v4 01/30] qcow2: Make Qcow2AioTask store the full host offset

2020-04-08 Thread Max Reitz
f, bytes) < 0) > { This { should now go on the preceding line; with that fixed: Reviewed-by: Max Reitz > ret = -EIO; > goto out_unlocked; signature.asc Description: OpenPGP digital signature

Re: [PATCH for-5.0 v3 2/3] block: Increase BB.in_flight for coroutine and sync interfaces

2020-04-07 Thread Max Reitz
ove it. > > Signed-off-by: Kevin Wolf > --- > include/sysemu/block-backend.h | 1 - > block/block-backend.c | 103 + > 2 files changed, 80 insertions(+), 24 deletions(-) Thanks! Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

[PULL 5/5] xen-block: Fix double qlist remove and request leak

2020-04-07 Thread Max Reitz
it message as per Paul's suggestions] Signed-off-by: Max Reitz --- hw/block/dataplane/xen-block.c | 48 -- 1 file changed, 16 insertions(+), 32 deletions(-) diff --git a/hw/block/dataplane/xen-block.c b/hw/block/dataplane/xen-block.c index 288a87a814..5f8f15778b

[PULL 1/5] qcow2: Forbid discard in qcow2 v2 images with backing files

2020-04-07 Thread Max Reitz
ia.com> Reviewed-by: Eric Blake Signed-off-by: Max Reitz --- block/qcow2.c | 6 +++ tests/qemu-iotests/046 | 10 ++-- tests/qemu-iotests/046.out | 12 +++-- tests/qemu-iotests/060 | 12 ++--- tests/qemu-iotests/060.out | 2 - tests/qemu-iotests/177 | 5 +- tests/qemu-io

[PULL 4/5] iotests/common.pattern: Quote echos

2020-04-07 Thread Max Reitz
ng the arguments to all echos in common.pattern. Signed-off-by: Max Reitz Message-Id: <20200403101134.805871-1-mre...@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Eric Blake Signed-off-by: Max Reitz --- tests/qemu-iotests/common.pattern | 22 +++--- 1 file

[PULL 3/5] qcow2: Check request size in qcow2_co_pwritev_compressed_part()

2020-04-07 Thread Max Reitz
es a regression introduced in 0d483dce38 Signed-off-by: Alberto Garcia Message-Id: <20200406143401.26854-1-be...@igalia.com> Reviewed-by: Andrey Shinkevich Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Max Reitz --- block/qcow2.c | 5 + 1 file changed, 5 insertions(+) diff --g

[PULL 2/5] qemu-img: Report convert errors by bytes, not sectors

2020-04-07 Thread Max Reitz
. Signed-off-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy Message-Id: <20200402135717.476398-1-ebl...@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Max Reitz --- qemu-img.c | 8 tests/qemu-iotests/244.out | 2 +- 2 files changed, 5 inse

[PULL 0/5] Block patches for 5.0-rc2

2020-04-07 Thread Max Reitz
in qcow2_co_pwritev_compressed_part() Anthony PERARD (1): xen-block: Fix double qlist remove and request leak Eric Blake (1): qemu-img: Report convert errors by bytes, not sectors Max Reitz (1): iotests/common.pattern: Quote echos block/qcow2.c | 11 hw/block/dataplane/xen-block.c

Re: [PATCH v2 for-5.0] xen-block: Fix double qlist remove and request leak

2020-04-07 Thread Max Reitz
On 06.04.20 16:02, Anthony PERARD wrote: > Commit a31ca6801c02 ("qemu/queue.h: clear linked list pointers on > remove") revealed that a request was removed twice from a list, once > in xen_block_finish_request() and a second time in > xen_block_release_request() when both function are called from

Re: [PATCH for-5.0 v2 2/3] block: Increase BB.in_flight for coroutine interfaces

2020-04-07 Thread Max Reitz
On 07.04.20 13:13, Kevin Wolf wrote: > Am 07.04.2020 um 12:15 hat Max Reitz geschrieben: >> On 07.04.20 12:04, Max Reitz wrote: >>> On 06.04.20 19:14, Kevin Wolf wrote: >>>> External callers of blk_co_*() don't currently increase the >>>> BlockBackend.

Re: [PATCH for-5.0 v2 2/3] block: Increase BB.in_flight for coroutine interfaces

2020-04-07 Thread Max Reitz
On 07.04.20 12:04, Max Reitz wrote: > On 06.04.20 19:14, Kevin Wolf wrote: >> External callers of blk_co_*() don't currently increase the >> BlockBackend.in_flight counter, but calls from blk_aio_*() do, so there >> is an inconsistency whether the count

Re: [PATCH for-5.0 v2 3/3] block: Fix blk->in_flight during blk_wait_while_drained()

2020-04-07 Thread Max Reitz
1 file changed, 5 insertions(+), 12 deletions(-) Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

Re: [PATCH for-5.0 v2 2/3] block: Increase BB.in_flight for coroutine interfaces

2020-04-07 Thread Max Reitz
Wolf > --- > include/sysemu/block-backend.h | 1 - > block/block-backend.c | 94 +++--- > 2 files changed, 76 insertions(+), 19 deletions(-) Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

Re: [PATCH for-5.0 v2 1/3] block-backend: Reorder flush/pdiscard function definitions

2020-04-07 Thread Max Reitz
block/block-backend.c | 92 +-- > 1 file changed, 46 insertions(+), 46 deletions(-) Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

Re: [PATCH] iotests/common.pattern: Quote echos

2020-04-07 Thread Max Reitz
On 03.04.20 12:11, Max Reitz wrote: > From time to time, my shell decides to repace the bracketed numbers here > by the numbers inside (i.e., "=== Clusters to be compressed [1]" is > printed as "=== Clusters to be compressed 1"). That makes tests that > use common.

Re: [PATCH v2] qcow2: Check request size in qcow2_co_pwritev_compressed_part()

2020-04-07 Thread Max Reitz
On 06.04.20 16:34, Alberto Garcia wrote: > When issuing a compressed write request the number of bytes must be a > multiple of the cluster size or reach the end of the last cluster. > > With the current code such requests are allowed and we hit an > assertion: > >$ qemu-img create -f qcow2

Re: [PATCH v2 2/2] iotests: rework test finding

2020-04-06 Thread Max Reitz
On 25.03.20 11:21, Vladimir Sementsov-Ogievskiy wrote: > Add python script with new logic of searching for tests: > > Old behavior: > - tests are named [0-9][0-9][0-9] > - tests must be registered in group file (even if test doesn't belong >to any group, like 142) > > New behavior: > -

Re: [PATCH for-5.0 2/2] block: Fix blk->in_flight during blk_wait_while_drained()

2020-04-06 Thread Max Reitz
On 03.04.20 16:50, Kevin Wolf wrote: > Am 03.04.2020 um 14:42 hat Max Reitz geschrieben: >> On 03.04.20 12:44, Kevin Wolf wrote: >>> Calling blk_wait_while_drained() while blk->in_flight is increased for >>> the current request is wrong because it will cause the d

Re: [PATCH for-5.0] vpc: Don't round up already aligned BAT sizes

2020-04-03 Thread Max Reitz
On 03.04.20 14:04, Kevin Wolf wrote: > Am 03.04.2020 um 10:55 hat Max Reitz geschrieben: >> On 02.04.20 11:36, Kevin Wolf wrote: >>> As reported on Launchpad, Azure apparently doesn't accept images for >>> upload that are not both aligned to 1 MB blocks and have

Re: [PATCH for-5.0 2/2] block: Fix blk->in_flight during blk_wait_while_drained()

2020-04-03 Thread Max Reitz
On 03.04.20 12:44, Kevin Wolf wrote: > Calling blk_wait_while_drained() while blk->in_flight is increased for > the current request is wrong because it will cause the drain operation > to deadlock. > > Many callers of blk_wait_while_drained() have already increased > blk->in_flight when called in

Re: [PATCH for-5.0 1/2] block: Don't blk_wait_while_drained() in blk_co_preadv/pwritev

2020-04-03 Thread Max Reitz
of blk_co_preadv() and blk_co_pwritev_part(), as this patch does. Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

[PATCH] iotests/common.pattern: Quote echos

2020-04-03 Thread Max Reitz
ng the arguments to all echos in common.pattern. Signed-off-by: Max Reitz --- tests/qemu-iotests/common.pattern | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/qemu-iotests/common.pattern b/tests/qemu-iotests/common.pattern index 4f5e5b

Re: [PATCH for-5.0? v3] qemu-img: Report convert errors by bytes, not sectors

2020-04-03 Thread Max Reitz
On 02.04.20 15:57, Eric Blake wrote: > Various qemu-img commands are inconsistent on whether they report > status/errors in terms of bytes or sector offsets. The latter is > confusing (especially as more places move to 4k block sizes), so let's > switch everything to just use bytes everywhere.

Re: [PATCH v10 10/14] iotests: add hmp helper with logging

2020-04-03 Thread Max Reitz
On 02.04.20 20:27, John Snow wrote: [...] > Are we squared up for this series? I am actually not sure. As far as I’m concerned, yes. I just had this question on how to use mypy. Max signature.asc Description: OpenPGP digital signature

Re: [PATCH for-5.0] vpc: Don't round up already aligned BAT sizes

2020-04-03 Thread Max Reitz
+num_bat_entries = DIV_ROUND_UP(total_sectors, block_size / 512); And the old code just looks like a wrong DIV_ROUND_UP() attempt. So: Reviewed-by: Max Reitz > > ret = blk_pwrite(blk, offset, buf, HEADER_SIZE, 0); > if (ret < 0) { > signature.asc Description: OpenPGP digital signature

Re: [PATCH v5] qcow2: Forbid discard in qcow2 v2 images with backing files

2020-04-03 Thread Max Reitz
On 31.03.20 13:43, Alberto Garcia wrote: > A discard request deallocates the selected clusters so they read back > as zeroes. This is done by clearing the cluster offset field and > setting QCOW_OFLAG_ZERO in the L2 entry. > > This flag is however only supported when qcow_version >= 3. In older >

Re: [PATCH v4 3/3] backup: don't acquire aio_context in backup_clean

2020-04-02 Thread Max Reitz
17a19. > > Signed-off-by: Stefan Reiter > --- > > With the two previous patches applied, the commit message should now hold > true. > > block/backup.c | 4 > 1 file changed, 4 deletions(-) Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

Re: [PATCH v4 2/3] replication: acquire aio context before calling job_cancel_sync

2020-04-02 Thread Max Reitz
On 01.04.20 10:15, Stefan Reiter wrote: > job_cancel_sync requires the job's lock to be held, all other callers > already do this (replication_stop, drive_backup_abort, > blockdev_backup_abort, job_cancel_sync_all, cancel_common). I think all other callers come directly from QMP, though, so they

Re: [PATCH v4 1/3] job: take each job's lock individually in job_txn_apply

2020-04-02 Thread Max Reitz
On 01.04.20 10:15, Stefan Reiter wrote: > All callers of job_txn_apply hold a single job's lock, but different > jobs within a transaction can have different contexts, thus we need to > lock each one individually before applying the callback function. > > Similar to job_completed_txn_abort this

Re: [PATCH v10 10/14] iotests: add hmp helper with logging

2020-04-01 Thread Max Reitz
On 01.04.20 15:51, Kevin Wolf wrote: > Am 01.04.2020 um 14:28 hat Max Reitz geschrieben: >> On 31.03.20 16:00, Kevin Wolf wrote: >>> Am 31.03.2020 um 12:21 hat Max Reitz geschrieben: >>>> On 31.03.20 02:00, John Snow wrote: >>>>> Minor clea

Re: [PATCH v10 10/14] iotests: add hmp helper with logging

2020-04-01 Thread Max Reitz
On 01.04.20 14:28, Max Reitz wrote: > On 31.03.20 16:00, Kevin Wolf wrote: >> Am 31.03.2020 um 12:21 hat Max Reitz geschrieben: >>> On 31.03.20 02:00, John Snow wrote: >>>> Minor cleanup for HMP functions; helps with line length and consolidates >>>> HMP h

Re: [PATCH v10 10/14] iotests: add hmp helper with logging

2020-04-01 Thread Max Reitz
On 31.03.20 19:39, Kevin Wolf wrote: > Am 31.03.2020 um 19:23 hat John Snow geschrieben: >> >> >> On 3/31/20 6:21 AM, Max Reitz wrote: >>> On 31.03.20 02:00, John Snow wrote: >>>> Minor cleanup for HMP functions; helps with line length and consolidates &

Re: [PATCH v10 10/14] iotests: add hmp helper with logging

2020-04-01 Thread Max Reitz
On 31.03.20 16:00, Kevin Wolf wrote: > Am 31.03.2020 um 12:21 hat Max Reitz geschrieben: >> On 31.03.20 02:00, John Snow wrote: >>> Minor cleanup for HMP functions; helps with line length and consolidates >>> HMP helpers through one implementation function. >

Re: [PATCH v4] qcow2: Forbid discard in qcow2 v2 images with backing files

2020-03-31 Thread Max Reitz
On 31.03.20 11:51, Alberto Garcia wrote: > On Tue 31 Mar 2020 10:57:18 AM CEST, Max Reitz wrote: >> I’ll have to dequeue it again, because it breaks iotests 046 and 177 >> (both of which already have special handling for v2-specific discard; >> but it needs to be adjusted

Re: [PATCH v10 13/14] iotests: Mark verify functions as private

2020-03-31 Thread Max Reitz
> > Signed-off-by: John Snow > --- > tests/qemu-iotests/iotests.py | 23 +-- > 1 file changed, 13 insertions(+), 10 deletions(-) Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

Re: [PATCH v10 10/14] iotests: add hmp helper with logging

2020-03-31 Thread Max Reitz
check > usages of the name. > > Signed-off-by: John Snow > --- > tests/qemu-iotests/iotests.py | 35 ++----- > 1 file changed, 22 insertions(+), 13 deletions(-) Reviewed-by: Max Reitz > diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotes

Re: [PATCH v4] qcow2: Forbid discard in qcow2 v2 images with backing files

2020-03-31 Thread Max Reitz
On 30.03.20 12:05, Max Reitz wrote: > On 27.03.20 19:59, Alberto Garcia wrote: >> A discard request deallocates the selected clusters so they read back >> as zeroes. This is done by clearing the cluster offset field and >> setting QCOW_OFLAG_ZERO in the L2 entry. >> &

Re: [PATCH v9 00/14] iotests: use python logging

2020-03-30 Thread Max Reitz
On 25.03.20 00:20, John Snow wrote: > This series uses python logging to enable output conditionally on > iotests.log(). We unify an initialization call (which also enables > debugging output for those tests with -d) and then make the switch > inside of iotests. > > It will help alleviate the

Re: [PATCH v9 10/14] iotests: add hmp helper with logging

2020-03-30 Thread Max Reitz
; For now, just offer a use_log parameter. > > Signed-off-by: John Snow > --- > tests/qemu-iotests/iotests.py | 30 +- > 1 file changed, 17 insertions(+), 13 deletions(-) Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

Re: [PATCH v9 09/14] iotests: limit line length to 79 chars

2020-03-30 Thread Max Reitz
On 30.03.20 14:31, Max Reitz wrote: > On 25.03.20 00:20, John Snow wrote: >> 79 is the PEP8 recommendation. This recommendation works well for >> reading patch diffs in TUI email clients. >> >> Signed-off-by: John Snow >> --- >&

Re: [PATCH v9 09/14] iotests: limit line length to 79 chars

2020-03-30 Thread Max Reitz
On 25.03.20 00:20, John Snow wrote: > 79 is the PEP8 recommendation. This recommendation works well for > reading patch diffs in TUI email clients. > > Signed-off-by: John Snow > --- > tests/qemu-iotests/iotests.py | 64 +++ > tests/qemu-iotests/pylintrc | 6

Re: [PATCH v9 08/14] iotests: touch up log function signature

2020-03-30 Thread Max Reitz
to make a dedicated patch for this, I might as well go all the way” patch. It’s quite cool. Reviewed-by: Max Reitz [1] I just read an article on that thing again (empty lists as default argument), which claims that this is in fact a very useful feature of Python. This makes me want to go

Re: [PATCH v9 07/14] iotests: drop pre-Python 3.4 compatibility code

2020-03-30 Thread Max Reitz
(-) I did say I wouldn’t complain about the unrelated change! *shrug* Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

Re: [PATCH v9 06/14] iotests: alphabetize standard imports

2020-03-30 Thread Max Reitz
On 25.03.20 00:20, John Snow wrote: > I had to fix a merge conflict, so do this tiny harmless thing while I'm > here. > > Signed-off-by: John Snow > --- > tests/qemu-iotests/iotests.py | 18 +- > 1 file changed, 9 insertions(+), 9 deletions(-) R

Re: [PATCH v4] qcow2: Forbid discard in qcow2 v2 images with backing files

2020-03-30 Thread Max Reitz
On 27.03.20 19:59, Alberto Garcia wrote: > A discard request deallocates the selected clusters so they read back > as zeroes. This is done by clearing the cluster offset field and > setting QCOW_OFLAG_ZERO in the L2 entry. > > This flag is however only supported when qcow_version >= 3. In older >

Re: [PATCH v2 2/2] mirror: Wait only for in-flight operations

2020-03-26 Thread Max Reitz
hat would mean we would always ignore is_in_flight for active-mirror operations. In practice, there’s no difference to what this patch does, i.e. to just let active-mirror operations have is_in_flight to be always true and let mirror_wait_for_any_operation() check is_in_flight unconditionally.

[PULL 09/10] iotests: Add poke_file_[bl]e functions

2020-03-26 Thread Max Reitz
Similarly to peek_file_[bl]e, we may want to write binary integers into a file. Currently, this often means messing around with poke_file and raw binary strings. I hope these functions make it a bit more comfortable. Signed-off-by: Max Reitz Code-suggested-by: Eric Blake Message-Id

[PULL 10/10] iotests/138: Test leaks/corruptions fixed report

2020-03-26 Thread Max Reitz
check not to check external data files' refcounts. But there are no such refcounts, so it is no mistake. Just say that qemu-img check does not do much for external data files, and this is why this test does not work with them. Signed-off-by: Max Reitz Message-Id: <20200324172757.1173824-4-

[PULL 08/10] qemu-img: Fix check's leak/corruption fix report

2020-03-26 Thread Max Reitz
) unfixed, they will at least be false on successful runs, because then the number of leaks and corruptions found in the second run should be 0.) We should save has_leaks_fixed and has_corruptions_fixed just like we save leaks_fixed and corruptions_fixed. Signed-off-by: Max Reitz Reviewed-by: Eric

[PULL 06/10] qcow2: Avoid feature name extension on small cluster size

2020-03-26 Thread Max Reitz
). Signed-off-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia Message-Id: <20200324174233.1622067-4-ebl...@redhat.com> Signed-off-by: Max Reitz --- block/qcow2.c | 11 +-- tests/qemu-iotests/036 | 6 -- tests/qemu-iotests/06

[PULL 07/10] sheepdog: Consistently set bdrv_has_zero_init_truncate

2020-03-26 Thread Max Reitz
of the three possible sheepdog instantiations. Fixes: 1dcaf527 Signed-off-by: Eric Blake Message-Id: <20200324174233.1622067-5-ebl...@redhat.com> Reviewed-by: John Snow Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Max Reitz --- block/sheepdog.c | 2 ++ 1 file changed, 2 insertions(+) diff

[PULL 04/10] qcow2: Comment typo fixes

2020-03-26 Thread Max Reitz
From: Eric Blake Various trivial typos noticed while working on this file. Signed-off-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia Message-Id: <20200324174233.1622067-2-ebl...@redhat.com> Signed-off-by: Max Reitz --- block/qcow2.c | 6 +++---

[PULL 05/10] qcow2: List autoclear bit names in header

2020-03-26 Thread Max Reitz
that are affected by the longer header length. Fixes: 88ddffae Fixes: 93c24936 Signed-off-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy Message-Id: <20200324174233.1622067-3-ebl...@redhat.com> Signed-off-by: Max Reitz --- docs/interop/qcow2.txt | 3 ++- block/q

[PULL 03/10] block: trickle down the fallback image creation function use to the block drivers

2020-03-26 Thread Max Reitz
Fixed alignment, and moved bdrv_co_create_opts_simple() and bdrv_create_opts_simple from block.h into block_int.h] Signed-off-by: Max Reitz --- include/block/block.h | 1 + include/block/block_int.h | 11 +++ block.c | 35 ---

[PULL 02/10] block: pass BlockDriver reference to the .bdrv_co_create

2020-03-26 Thread Max Reitz
From: Maxim Levitsky This will allow the reuse of a single generic .bdrv_co_create implementation for several drivers. No functional changes. Signed-off-by: Maxim Levitsky Message-Id: <20200326011218.29230-2-mlevi...@redhat.com> Reviewed-by: Denis V. Lunev Signed-off-by: Max

[PULL 00/10] Block patches for 5.0-rc1

2020-03-26 Thread Max Reitz
feature name extension on small cluster size sheepdog: Consistently set bdrv_has_zero_init_truncate Max Reitz (3): qemu-img: Fix check's leak/corruption fix report iotests: Add poke_file_[bl]e functions iotests/138: Test leaks/corruptions fixed report Maxim Levitsky (2): block: pass

[PULL 01/10] block/mirror: fix use after free of local_err

2020-03-26 Thread Max Reitz
com> Reviewed-by: Eric Blake Reviewed-by: John Snow Signed-off-by: Max Reitz --- block/mirror.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/mirror.c b/block/mirror.c index 447051dbc6..6203e5946e 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -678,6 +678,7 @@ stat

Re: [PATCH for-5.0 v2 0/3] qemu-img: Fix check's leak/corruption fix report

2020-03-26 Thread Max Reitz
On 24.03.20 18:27, Max Reitz wrote: > Branch: https://github.com/XanClic/qemu.git fix-check-result-v2 > Branch: https://git.xanclic.moe/XanClic/qemu.git fix-check-result-v2 > > v1: https://lists.nongnu.org/archive/html/qemu-block/2020-02/msg01418.html Thanks for the review again, a

Re: [PATCH 2/2] block: trickle down the fallback image creation function use to the block drivers

2020-03-26 Thread Max Reitz
On 26.03.20 14:35, Eric Blake wrote: > On 3/26/20 8:28 AM, Kevin Wolf wrote: >> Am 26.03.2020 um 14:20 hat Eric Blake geschrieben: +++ b/block/file-posix.c @@ -3513,6 +3513,8 @@ static BlockDriver bdrv_host_device = {    .bdrv_reopen_prepare = raw_reopen_prepare,   

Re: [PATCH 0/2] Fix the generic image creation code

2020-03-26 Thread Max Reitz
On 26.03.20 13:23, Max Reitz wrote: > On 26.03.20 02:12, Maxim Levitsky wrote: >> The recent patches from Max Reitz allowed some block drivers to not >> provide the .bdrv_co_create_opts and still allow qemu-img to >> create/format images as long as the imag

Re: [PATCH for-5.0 v2 0/4] bug fixes extracted from larger qcow2 zero bit work

2020-03-26 Thread Max Reitz
On 24.03.20 18:42, Eric Blake wrote: > My proposal [1] to add an autoclear all-zero-content bit to the qcow2 > format has now stalled into 5.1 territory, but several patches in my > initial proposal are uncontroversial and obvious bug fixes worth > having in 5.0. > > [1]

Re: [PATCH 0/2] Fix the generic image creation code

2020-03-26 Thread Max Reitz
On 26.03.20 02:12, Maxim Levitsky wrote: > The recent patches from Max Reitz allowed some block drivers to not > provide the .bdrv_co_create_opts and still allow qemu-img to > create/format images as long as the image is already existing > (that is the case with various block storage

Re: [PATCH 2/2] block: trickle down the fallback image creation function use to the block drivers

2020-03-26 Thread Max Reitz
On 26.03.20 02:12, Maxim Levitsky wrote: > Instead of checking the .bdrv_co_create_opts to see if we need the failback, > just implement the .bdrv_co_create_opts in the drivers that need it. > > This way we don't break various places that need to know if the underlying > protocol/format really

Re: [PATCH v2 3/4] qcow2: Avoid feature name extension on small cluster size

2020-03-25 Thread Max Reitz
On 25.03.20 14:18, Eric Blake wrote: > On 3/25/20 7:42 AM, Max Reitz wrote: >> On 24.03.20 18:42, Eric Blake wrote: >>> As the feature name table can be quite large (over 9k if all 64 bits >>> of all three feature fields have names; a mere 8 features leaves only >>

Re: [PATCH v2 3/4] qcow2: Avoid feature name extension on small cluster size

2020-03-25 Thread Max Reitz
On 24.03.20 18:42, Eric Blake wrote: > As the feature name table can be quite large (over 9k if all 64 bits > of all three feature fields have names; a mere 8 features leaves only > 8 bytes for a backing file name in a 512-byte cluster), it is unwise > to emit this optional header in images with

Re: [PATCH 2/6] block/mirror: fix use after free of local_err

2020-03-25 Thread Max Reitz
On 24.03.20 16:36, Vladimir Sementsov-Ogievskiy wrote: > local_err is used again in mirror_exit_common() after > bdrv_set_backing_hd(), so we must zero it. Otherwise try to set > non-NULL local_err will crash. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/mirror.c | 1 + > 1

Re: [PATCH 2/6] block/mirror: fix use after free of local_err

2020-03-25 Thread Max Reitz
On 25.03.20 12:47, Vladimir Sementsov-Ogievskiy wrote: > 25.03.2020 14:11, Max Reitz wrote: >> On 24.03.20 16:36, Vladimir Sementsov-Ogievskiy wrote: >>> local_err is used again in mirror_exit_common() after >>> bdrv_set_backing_hd(), so we must zero it. Otherwise try to

Re: [PATCH 2/6] block/mirror: fix use after free of local_err

2020-03-25 Thread Max Reitz
On 25.03.20 12:11, Max Reitz wrote: > On 24.03.20 16:36, Vladimir Sementsov-Ogievskiy wrote: >> local_err is used again in mirror_exit_common() after >> bdrv_set_backing_hd(), so we must zero it. Otherwise try to set >> non-NULL local_err will crash. > > OK, but wo

Re: [PATCH 2/6] block/mirror: fix use after free of local_err

2020-03-25 Thread Max Reitz
On 24.03.20 16:36, Vladimir Sementsov-Ogievskiy wrote: > local_err is used again in mirror_exit_common() after > bdrv_set_backing_hd(), so we must zero it. Otherwise try to set > non-NULL local_err will crash. OK, but wouldn’t it be better hygiene to set it to NULL every time it is freed? (There

Re: [PATCH v8 07/11] iotests: limit line length to 79 chars

2020-03-24 Thread Max Reitz
On 24.03.20 18:09, John Snow wrote: > > > On 3/24/20 11:12 AM, Max Reitz wrote: >> On 24.03.20 16:02, Max Reitz wrote: >>> On 17.03.20 01:41, John Snow wrote: >>>> 79 is the PEP8 recommendation. This recommendation works well for >>>> reading patch

[PATCH for-5.0 v2 3/3] iotests/138: Test leaks/corruptions fixed report

2020-03-24 Thread Max Reitz
check not to check external data files' refcounts. But there are no such refcounts, so it is no mistake. Just say that qemu-img check does not do much for external data files, and this is why this test does not work with them. Signed-off-by: Max Reitz --- tests/qemu-iotests/138 | 41

[PATCH for-5.0 v2 1/3] qemu-img: Fix check's leak/corruption fix report

2020-03-24 Thread Max Reitz
) unfixed, they will at least be false on successful runs, because then the number of leaks and corruptions found in the second run should be 0.) We should save has_leaks_fixed and has_corruptions_fixed just like we save leaks_fixed and corruptions_fixed. Signed-off-by: Max Reitz Reviewed-by: Eric

[PATCH for-5.0 v2 0/3] qemu-img: Fix check's leak/corruption fix report

2020-03-24 Thread Max Reitz
differences, respectively 001/3:[] [--] 'qemu-img: Fix check's leak/corruption fix report' 002/3:[0029] [FC] 'iotests: Add poke_file_[bl]e functions' 003/3:[0008] [FC] 'iotests/138: Test leaks/corruptions fixed report' Max Reitz (3): qemu-img: Fix check's leak/corruption fix report iotests: Add p

[PATCH for-5.0 v2 2/3] iotests: Add poke_file_[bl]e functions

2020-03-24 Thread Max Reitz
Similarly to peek_file_[bl]e, we may want to write binary integers into a file. Currently, this often means messing around with poke_file and raw binary strings. I hope these functions make it a bit more comfortable. Signed-off-by: Max Reitz Code-suggested-by: Eric Blake --- tests/qemu

Re: [PATCH v8 11/11] iotests: use python logging for iotests.log()

2020-03-24 Thread Max Reitz
ts/030| 4 +-- > tests/qemu-iotests/155| 2 +- > tests/qemu-iotests/245| 1 + > tests/qemu-iotests/245.out| 24 > tests/qemu-iotests/iotests.py | 53 --- > 5 files changed, 46 insertions(+), 38 deletions(-) Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

Re: [PATCH v8 07/11] iotests: limit line length to 79 chars

2020-03-24 Thread Max Reitz
On 24.03.20 16:02, Max Reitz wrote: > On 17.03.20 01:41, John Snow wrote: >> 79 is the PEP8 recommendation. This recommendation works well for >> reading patch diffs in TUI email clients. > > Also for my very GUI-y diff program (kompare). > >> Signed-off-by: Jo

Re: [PATCH v8 07/11] iotests: limit line length to 79 chars

2020-03-24 Thread Max Reitz
On 17.03.20 01:41, John Snow wrote: > 79 is the PEP8 recommendation. This recommendation works well for > reading patch diffs in TUI email clients. Also for my very GUI-y diff program (kompare). > Signed-off-by: John Snow > --- > tests/qemu-iotests/iotests.py | 64

Re: [PATCH v8 06/11] iotests: drop Python 3.4 compatibility code

2020-03-24 Thread Max Reitz
t; None: > +""" > +Logs either a string message or a JSON serializable message (like QMP). > +If indent is provided, JSON serializable messages are pretty-printed. > +""" I feel like I should complain about this unrelated (I think?)

Re: [PATCH v8 05/11] iotests: add pylintrc file

2020-03-24 Thread Max Reitz
hanged, 22 insertions(+) > create mode 100644 tests/qemu-iotests/pylintrc Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

Re: [PATCH v8 04/11] iotests: replace mutable list default args

2020-03-24 Thread Max Reitz
wed-by: Philippe Mathieu-Daudé > --- > tests/qemu-iotests/iotests.py | 24 > 1 file changed, 12 insertions(+), 12 deletions(-) Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

Re: [PATCH v8 03/11] iotests: ignore import warnings from pylint

2020-03-24 Thread Max Reitz
s error for now. > > Signed-off-by: John Snow > --- > tests/qemu-iotests/iotests.py | 1 + > 1 file changed, 1 insertion(+) Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

<    13   14   15   16   17   18   19   20   21   22   >