Re: [PATCH 10/10] qcow2-refcount: check_refblocks(): add separate message for reserved

2021-05-04 Thread Eric Blake
On 5/4/21 10:20 AM, Vladimir Sementsov-Ogievskiy wrote: > Split checking for reserved bits out of aligned offset check. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/qcow2.h | 1 + > block/qcow2-refcount.c | 10 +- > 2 files changed, 10 insertions(+), 1

Re: [PATCH 09/10] qcow2-refcount: check_refcounts_l1(): check reserved bits

2021-05-04 Thread Eric Blake
On 5/4/21 10:20 AM, Vladimir Sementsov-Ogievskiy wrote: > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/qcow2.h | 1 + > block/qcow2-refcount.c | 6 ++ > 2 files changed, 7 insertions(+) > Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat,

Re: [PATCH 08/10] qcow2-refcount: improve style of check_refcounts_l1()

2021-05-04 Thread Eric Blake
On 5/4/21 10:20 AM, Vladimir Sementsov-Ogievskiy wrote: > - use g_autofree for l1_table > - better name for size in bytes variable > - reduce code blocks nesting > - whitespaces, braces, newlines > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/qcow2-refcount.c | 97

Re: [PATCH 07/10] qcow2-refcount: check_refcounts_l2(): check reserved bits

2021-05-04 Thread Eric Blake
On 5/4/21 10:20 AM, Vladimir Sementsov-Ogievskiy wrote: > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/qcow2.h | 1 + > block/qcow2-refcount.c | 12 +++- > 2 files changed, 12 insertions(+), 1 deletion(-) > Reviewed-by: Eric Blake -- Eric Blake, Principal

Re: [PATCH 06/10] qcow2-refcount: check_refcounts_l2(): check l2_bitmap

2021-05-04 Thread Eric Blake
On 5/4/21 10:20 AM, Vladimir Sementsov-Ogievskiy wrote: > Check subcluster bitmap of the l2 entry for different types of > clusters: > > - for compressed it must be zero > - for allocated check consistency of two parts of the bitmap > - for unallocated all subclusters should be unallocated >

Re: [PATCH 05/10] qcow2-refcount: fix_l2_entry_by_zero(): also zero L2 entry bitmap

2021-05-04 Thread Eric Blake
On 5/4/21 10:20 AM, Vladimir Sementsov-Ogievskiy wrote: > We'll reuse the function to fix wrong L2 entry bitmap. Support it now. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/qcow2-refcount.c | 18 +++--- > 1 file changed, 15 insertions(+), 3 deletions(-) > > diff

Re: [PATCH 04/10] qcow2-refcount: introduce fix_l2_entry_by_zero()

2021-05-04 Thread Eric Blake
On 5/4/21 10:20 AM, Vladimir Sementsov-Ogievskiy wrote: > Split fix_l2_entry_by_zero() out of check_refcounts_l2() to be > reused in further patch. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/qcow2-refcount.c | 87 +- > 1 file changed,

Re: [PATCH 03/10] qcow2: introduce qcow2_parse_compressed_l2_entry() helper

2021-05-04 Thread Eric Blake
On 5/4/21 10:20 AM, Vladimir Sementsov-Ogievskiy wrote: > Add helper to parse compressed l2_entry and use it everywhere instead > of opencoding. open-coding > > Note, that in most places we move to precise coffset/csize instead of > sector-aligned. Still it should work good enough for updating

Re: [PATCH 02/10] qcow2: compressed read: simplify cluster descriptor passing

2021-05-04 Thread Eric Blake
On 5/4/21 10:20 AM, Vladimir Sementsov-Ogievskiy wrote: > Let's pass the whole L2 entry and not bother with > L2E_COMPRESSED_OFFSET_SIZE_MASK. > > It also helps further refactoring that adds generic > qcow2_parse_compressed_l2_entry() helper. > > Signed-off-by: Vladimir Sementsov-Ogievskiy >

Re: [PATCH 01/10] qcow2-refcount: improve style of check_refcounts_l2()

2021-05-04 Thread Eric Blake
On 5/4/21 10:20 AM, Vladimir Sementsov-Ogievskiy wrote: > - don't use same name for size in bytes and in entries > - use g_autofree for l2_table > - add whitespace > - fix block comment style > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/qcow2-refcount.c | 47

Re: [PATCH] qcow2: set bdi->is_dirty

2021-05-04 Thread Kirill Tkhai
On 04.05.2021 19:06, Vladimir Sementsov-Ogievskiy wrote: > Set bdi->is_dirty, so that qemu-img info could show dirty flag. > > After this commit the following check will show '"dirty-flag": true': > > ./build/qemu-img create -f qcow2 -o lazy_refcounts=on x 1M > ./build/qemu-io x > qemu-io> write

Re: [PATCH] qcow2: set bdi->is_dirty

2021-05-04 Thread Eric Blake
On 5/4/21 11:06 AM, Vladimir Sementsov-Ogievskiy wrote: > Set bdi->is_dirty, so that qemu-img info could show dirty flag. > > After this commit the following check will show '"dirty-flag": true': > > ./build/qemu-img create -f qcow2 -o lazy_refcounts=on x 1M > ./build/qemu-io x > qemu-io> write

[PATCH] qcow2: set bdi->is_dirty

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
Set bdi->is_dirty, so that qemu-img info could show dirty flag. After this commit the following check will show '"dirty-flag": true': ./build/qemu-img create -f qcow2 -o lazy_refcounts=on x 1M ./build/qemu-io x qemu-io> write 0 1M After "write" command success, kill the qemu-io process: kill

Re: [PATCH] virtio-blk: drop deprecated scsi=on|off property

2021-05-04 Thread Eduardo Habkost
On Tue, May 04, 2021 at 03:32:55PM +0100, Stefan Hajnoczi wrote: > On Thu, Apr 29, 2021 at 02:03:52PM -0400, Eduardo Habkost wrote: > > On Thu, Apr 29, 2021 at 04:52:21PM +0100, Stefan Hajnoczi wrote: > > > Live migrating old guests from an old QEMU with the SCSI feature bit > > > enabled will

[PATCH 02/10] qcow2: compressed read: simplify cluster descriptor passing

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
Let's pass the whole L2 entry and not bother with L2E_COMPRESSED_OFFSET_SIZE_MASK. It also helps further refactoring that adds generic qcow2_parse_compressed_l2_entry() helper. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/qcow2.h | 1 - block/qcow2-cluster.c | 5 ++---

[PATCH 09/10] qcow2-refcount: check_refcounts_l1(): check reserved bits

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/qcow2.h | 1 + block/qcow2-refcount.c | 6 ++ 2 files changed, 7 insertions(+) diff --git a/block/qcow2.h b/block/qcow2.h index b8b1093b61..58fd7f1678 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -586,6 +586,7 @@ typedef

[PATCH 08/10] qcow2-refcount: improve style of check_refcounts_l1()

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
- use g_autofree for l1_table - better name for size in bytes variable - reduce code blocks nesting - whitespaces, braces, newlines Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/qcow2-refcount.c | 97 +- 1 file changed, 49 insertions(+), 48

[PATCH 07/10] qcow2-refcount: check_refcounts_l2(): check reserved bits

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/qcow2.h | 1 + block/qcow2-refcount.c | 12 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/block/qcow2.h b/block/qcow2.h index c0e1e83796..b8b1093b61 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@

[PATCH 05/10] qcow2-refcount: fix_l2_entry_by_zero(): also zero L2 entry bitmap

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
We'll reuse the function to fix wrong L2 entry bitmap. Support it now. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/qcow2-refcount.c | 18 +++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index

[PATCH 06/10] qcow2-refcount: check_refcounts_l2(): check l2_bitmap

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
Check subcluster bitmap of the l2 entry for different types of clusters: - for compressed it must be zero - for allocated check consistency of two parts of the bitmap - for unallocated all subclusters should be unallocated (or zero-plain) For unallocated clusters we can safely fix the

[PATCH 10/10] qcow2-refcount: check_refblocks(): add separate message for reserved

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
Split checking for reserved bits out of aligned offset check. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/qcow2.h | 1 + block/qcow2-refcount.c | 10 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/block/qcow2.h b/block/qcow2.h index

[PATCH 01/10] qcow2-refcount: improve style of check_refcounts_l2()

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
- don't use same name for size in bytes and in entries - use g_autofree for l2_table - add whitespace - fix block comment style Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/qcow2-refcount.c | 47 +- 1 file changed, 24 insertions(+), 23

[PATCH 04/10] qcow2-refcount: introduce fix_l2_entry_by_zero()

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
Split fix_l2_entry_by_zero() out of check_refcounts_l2() to be reused in further patch. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/qcow2-refcount.c | 87 +- 1 file changed, 60 insertions(+), 27 deletions(-) diff --git a/block/qcow2-refcount.c

[PATCH 00/10] qcow2 check: check some reserved bits and subcluster bitmaps

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
Hi all! Here are some good refactorings and new (qemu-img check) checks for qcow2. Vladimir Sementsov-Ogievskiy (10): qcow2-refcount: improve style of check_refcounts_l2() qcow2: compressed read: simplify cluster descriptor passing qcow2: introduce qcow2_parse_compressed_l2_entry() helper

[PATCH 03/10] qcow2: introduce qcow2_parse_compressed_l2_entry() helper

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
Add helper to parse compressed l2_entry and use it everywhere instead of opencoding. Note, that in most places we move to precise coffset/csize instead of sector-aligned. Still it should work good enough for updating refcounts. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/qcow2.h

Re: [PATCH] block/rbd: Add support for rbd image encryption

2021-05-04 Thread Daniel P . Berrangé
On Sun, May 02, 2021 at 10:36:17AM +0300, Or Ozeri wrote: > Starting from ceph Pacific, RBD has built-in support for image-level > encryption. > Currently supported formats are LUKS version 1 and 2. > > There are 2 new relevant librbd APIs for controlling encryption, both expect > an > open

Re: [PATCH] virtio-blk: drop deprecated scsi=on|off property

2021-05-04 Thread Stefan Hajnoczi
On Thu, Apr 29, 2021 at 02:03:52PM -0400, Eduardo Habkost wrote: > On Thu, Apr 29, 2021 at 04:52:21PM +0100, Stefan Hajnoczi wrote: > > Live migrating old guests from an old QEMU with the SCSI feature bit > > enabled will fail with "Features 0x... unsupported. Allowed features: > > 0x...". We've

Re: [PATCH] virtio-blk: drop deprecated scsi=on|off property

2021-05-04 Thread Stefan Hajnoczi
On Thu, Apr 29, 2021 at 06:16:28PM +0200, Peter Krempa wrote: > On Thu, Apr 29, 2021 at 16:52:21 +0100, Stefan Hajnoczi wrote: > > The scsi=on|off property was deprecated in QEMU 5.0 and can be removed > > completely at this point. > > > > Drop the scsi=on|off option. It was only available on

Re: [PATCH] virtio-blk: drop deprecated scsi=on|off property

2021-05-04 Thread Stefan Hajnoczi
On Thu, Apr 29, 2021 at 02:03:52PM -0400, Eduardo Habkost wrote: > On Thu, Apr 29, 2021 at 04:52:21PM +0100, Stefan Hajnoczi wrote: > > The scsi=on|off property was deprecated in QEMU 5.0 and can be removed > > completely at this point. > > > > Drop the scsi=on|off option. It was only available

Re: [ANNOUNCE] libblkio v0.1.0 preview release

2021-05-04 Thread Kevin Wolf
Am 30.04.2021 um 17:49 hat Stefan Hajnoczi geschrieben: > On Thu, Apr 29, 2021 at 05:51:16PM +0200, Kevin Wolf wrote: > > Am 29.04.2021 um 16:05 hat Stefan Hajnoczi geschrieben: > > > Hi, > > > A preview release of libblkio, a library for high-performance block I/O, > > > is now available: > > >

Re: [PATCH 2/2] qemu-img: Require -F with -b backing image

2021-05-04 Thread Eric Blake
On 5/3/21 4:45 PM, Eric Blake wrote: > On 5/3/21 4:36 PM, Eric Blake wrote: >> Back in commit d9f059aa6c (qemu-img: Deprecate use of -b without -F), >> we deprecated the ability to create a file with a backing image that >> requires qemu to perform format probing. Qemu can still probe older >>

Re: [PATCH v2 2/6] vhost-user-blk: Don't reconnect during initialisation

2021-05-04 Thread Michael S. Tsirkin
On Tue, May 04, 2021 at 12:57:29PM +0200, Kevin Wolf wrote: > Am 04.05.2021 um 11:44 hat Michael S. Tsirkin geschrieben: > > On Tue, May 04, 2021 at 11:27:12AM +0200, Kevin Wolf wrote: > > > Am 04.05.2021 um 10:59 hat Michael S. Tsirkin geschrieben: > > > > On Thu, Apr 29, 2021 at 07:13:12PM

Re: [PATCH v2 2/6] vhost-user-blk: Don't reconnect during initialisation

2021-05-04 Thread Kevin Wolf
Am 04.05.2021 um 11:44 hat Michael S. Tsirkin geschrieben: > On Tue, May 04, 2021 at 11:27:12AM +0200, Kevin Wolf wrote: > > Am 04.05.2021 um 10:59 hat Michael S. Tsirkin geschrieben: > > > On Thu, Apr 29, 2021 at 07:13:12PM +0200, Kevin Wolf wrote: > > > > This is a partial revert of commits

Re: [PATCH] virtio-blk: drop deprecated scsi=on|off property

2021-05-04 Thread Dr. David Alan Gilbert
* Peter Krempa (pkre...@redhat.com) wrote: > On Fri, Apr 30, 2021 at 09:42:05 +0200, Markus Armbruster wrote: > > Eduardo Habkost writes: > > > > > On Thu, Apr 29, 2021 at 04:52:21PM +0100, Stefan Hajnoczi wrote: > > >> The scsi=on|off property was deprecated in QEMU 5.0 and can be removed > >

[PATCH v2 0/5] block permission updated follow-up

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
v2: rebased on Kevin's "[PATCH 0/2] block: Fix Transaction leaks" 1: add assertions and drop extra declaration 2: add Alberto's r-b 3: improve commit message Based-on: <20210503110555.24001-1-kw...@redhat.com> Vladimir Sementsov-Ogievskiy (5): block: document child argument of

[PATCH v2 2/5] block-backend: improve blk_root_get_parent_desc()

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
We have different types of parents: block nodes, block backends and jobs. So, it makes sense to specify type together with name. While being here also use g_autofree. iotest 307 output is updated. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia ---

[PATCH v2 1/5] block: document child argument of bdrv_attach_child_common()

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
The logic around **child is not obvious: this reference is used not only to return resulting child, but also to rollback NULL value on transaction abort. So, let's add documentation and some assertions. While being here, drop extra declaration of bdrv_attach_child_noperm(). Signed-off-by:

[PATCH v2 5/5] block: improve permission conflict error message

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
Now permissions are updated as follows: 1. do graph modifications ignoring permissions 2. do permission update (of course, we rollback [1] if [2] fails) So, on stage [2] we can't say which users are "old" and which are "new" and exist only since [1]. And current error message is a bit

[PATCH v2 4/5] block: simplify bdrv_child_user_desc()

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
All existing parent types (block nodes, block devices, jobs) has the realization. So, drop unreachable code. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/block.c b/block.c index 54a3da9311..2f73523285 100644 ---

[PATCH v2 3/5] block: improve bdrv_child_get_parent_desc()

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
We have different types of parents: block nodes, block backends and jobs. So, it makes sense to specify type together with name. Next, this handler us used to compose an error message about permission conflict. And permission conflict occurs in a specific place of block graph. We shouldn't report

Re: [PATCH v2 2/6] vhost-user-blk: Don't reconnect during initialisation

2021-05-04 Thread Michael S. Tsirkin
On Tue, May 04, 2021 at 11:27:12AM +0200, Kevin Wolf wrote: > Am 04.05.2021 um 10:59 hat Michael S. Tsirkin geschrieben: > > On Thu, Apr 29, 2021 at 07:13:12PM +0200, Kevin Wolf wrote: > > > This is a partial revert of commits 77542d43149 and bc79c87bcde. > > > > > > Usually, an error during

Re: [PATCH v2 2/6] vhost-user-blk: Don't reconnect during initialisation

2021-05-04 Thread Kevin Wolf
Am 04.05.2021 um 10:59 hat Michael S. Tsirkin geschrieben: > On Thu, Apr 29, 2021 at 07:13:12PM +0200, Kevin Wolf wrote: > > This is a partial revert of commits 77542d43149 and bc79c87bcde. > > > > Usually, an error during initialisation means that the configuration was > > wrong. Reconnecting

[PULL 3/9] simplebench/bench-backup: add --compressed option

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
Allow bench compressed backup. Signed-off-by: Vladimir Sementsov-Ogievskiy --- scripts/simplebench/bench-backup.py| 55 ++ scripts/simplebench/bench_block_job.py | 23 +++ 2 files changed, 62 insertions(+), 16 deletions(-) diff --git

[PULL 7/9] simplebench/bench-backup: add --count and --no-initial-run

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
Add arguments to set number of test runs per table cell and to disable initial run that is not counted in results. It's convenient to set --count 1 --no-initial-run to fast run test onece, and to set --count to some large enough number for good precision of the results. Signed-off-by: Vladimir

Re: [PATCH v2 2/6] vhost-user-blk: Don't reconnect during initialisation

2021-05-04 Thread Kevin Wolf
Am 03.05.2021 um 19:01 hat Raphael Norwitz geschrieben: > So we're not going with the suggestion to retry once or a fixed number > of times? Any reason why not? I thought we agreed that we'd add reconnection back in a follow-up series that also addresses the different kinds of errors and retries

[PULL 9/9] MAINTAINERS: update Benchmark util: add git tree

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 4c05ff8bba..f9f2acea8f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2531,6 +2531,7 @@ Benchmark util M: Vladimir Sementsov-Ogievskiy S: Maintained

[PULL 8/9] simplebench/bench-backup: add --drop-caches argument

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
Add an option to drop caches before each test run. It may probably improve reliability of results when testing in cached mode. Signed-off-by: Vladimir Sementsov-Ogievskiy --- scripts/simplebench/bench-backup.py | 6 +- scripts/simplebench/simplebench.py | 11 ++- 2 files changed,

[PULL 2/9] simplebench: bench_one(): support count=1

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
statistics.stdev raises if sequence length is less than two. Support that case by hand. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow --- scripts/simplebench/simplebench.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git

[PULL 6/9] simplebench/bench-backup: support qcow2 source files

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
Add support for qcow2 source. New option says to use test-source.qcow2 instead of test-source. Of course, test-source.qcow2 should be precreated. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow --- scripts/simplebench/bench-backup.py| 5 +

[PULL 5/9] simplebench/bench_block_job: handle error in BLOCK_JOB_COMPLETED

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
We should not report success if there is an error in final event. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow --- scripts/simplebench/bench_block_job.py | 4 1 file changed, 4 insertions(+) diff --git a/scripts/simplebench/bench_block_job.py

[PULL 1/9] simplebench: bench_one(): add slow_limit argument

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
Sometimes one of cells in a testing table runs too slow. And we really don't want to wait so long. Limit number of runs in this case. Signed-off-by: Vladimir Sementsov-Ogievskiy --- scripts/simplebench/simplebench.py | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff

Re: [PATCH v2 2/6] vhost-user-blk: Don't reconnect during initialisation

2021-05-04 Thread Michael S. Tsirkin
On Thu, Apr 29, 2021 at 07:13:12PM +0200, Kevin Wolf wrote: > This is a partial revert of commits 77542d43149 and bc79c87bcde. > > Usually, an error during initialisation means that the configuration was > wrong. Reconnecting won't make the error go away, but just turn the > error condition into

[PULL 4/9] simplebench/bench-backup: add target-cache argument

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
Allow benchmark with different kinds of target cache. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow --- scripts/simplebench/bench-backup.py| 33 -- scripts/simplebench/bench_block_job.py | 10 +--- 2 files changed, 33 insertions(+), 10

[PULL 0/9] scripts/simplebench patches

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
The following changes since commit 53c5433e84e8935abed8e91d4a2eb813168a0ecf: Merge remote-tracking branch 'remotes/rth-gitlab/tags/pull-tcg-20210501' into staging (2021-05-02 12:02:46 +0100) are available in the Git repository at: https://src.openvz.org/scm/~vsementsov/qemu.git

Re: [PATCH v3 0/9] simplebench improvements

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
23.03.2021 16:47, Vladimir Sementsov-Ogievskiy wrote: Hi all! Here are some improvements to simplebench lib, to support my "qcow2: compressed write cache" series. v3: 01: use simpler logic 02,04-06: add John's r-b 07: use BooleanOptionalAction and initial_run=args.initial_run 08: rewrite

[PATCH v2 8/9] test-write-threshold: drop extra includes

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/unit/test-write-threshold.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/unit/test-write-threshold.c b/tests/unit/test-write-threshold.c index 49b1ef7a20..761054eab2 100644 --- a/tests/unit/test-write-threshold.c +++

[PATCH v2 5/9] block/write-threshold: don't use aio context lock

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
Instead of relying on aio context lock, let's make use of atomic operations. The tricky place is bdrv_write_threshold_check_write(): we want atomically unset bs->write_threshold_offset iff offset + bytes > bs->write_threshold_offset We don't have such atomic operation, so let's go in a loop:

[PATCH v2 4/9] block/write-threshold: drop extra APIs

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
bdrv_write_threshold_exceeded() is unused at all. bdrv_write_threshold_is_set() is used only to double check the value of bs->write_threshold_offset in tests. No real sense in it (both tests do check real value with help of bdrv_write_threshold_get()) Signed-off-by: Vladimir Sementsov-Ogievskiy

[PATCH v2 9/9] block/write-threshold: drop extra includes

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/write-threshold.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/block/write-threshold.c b/block/write-threshold.c index fbf4e6f5c4..db271c5537 100644 --- a/block/write-threshold.c +++ b/block/write-threshold.c @@ -12,10 +12,7 @@ */

[PATCH v2 7/9] test-write-threshold: drop extra TestStruct structure

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
We don't need this extra logic: it doesn't make code simpler. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/unit/test-write-threshold.c | 20 +++- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/tests/unit/test-write-threshold.c

[PATCH v2 6/9] test-write-threshold: drop extra tests

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
Testing set/get of one 64bit variable doesn't seem necessary. We have a lot of such variables. Also remaining tests do test set/get anyway. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/unit/test-write-threshold.c | 43 --- 1 file changed, 43 deletions(-)

[PATCH v2 2/9] block: drop write notifiers

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
They are unused now. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block_int.h | 12 block.c | 1 - block/io.c| 6 -- 3 files changed, 19 deletions(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index

[PATCH v2 1/9] block/write-threshold: don't use write notifiers

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
write-notifiers are used only for write-threshold. New code for such purpose should create filters. Let's better special-case write-threshold and drop write notifiers at all. (Actually, write-threshold is special-cased anyway, as the only user of write-notifiers) Signed-off-by: Vladimir

[PATCH v2 3/9] test-write-threshold: rewrite test_threshold_(not_)trigger tests

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
These tests use bdrv_write_threshold_exceeded() API, which is used only for test. Better is testing real API, which is used in block.c as well. So, let's call bdrv_write_threshold_check_write(), and check is bs->write_threshold_offset cleared or not (it's cleared iff threshold triggered). Also

[PATCH v2 0/9] block: refactor write threshold

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
Hi all! This is a v2 for "[PATCH] block: simplify write-threshold and drop write notifiers" Supersedes: <20210421220950.105017-1-vsement...@virtuozzo.com> v2: split into several patches, improve thread-safety, more refactoring Vladimir Sementsov-Ogievskiy (9): block/write-threshold: don't use

Re: [PATCH v2] Document qemu-img options data_file and data_file_raw

2021-05-04 Thread Max Reitz
On 04.05.21 01:15, Connor Kuehl wrote: On 4/30/21 9:45 AM, Max Reitz wrote: + ``data_file_raw`` +If this option is set to ``on``, QEMU will always keep the external +data file consistent as a standalone read-only raw image. It does +this by forwarding updates through to the raw

Re: [PATCH 1/6] block: fix leak of tran in bdrv_root_attach_child

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
03.05.2021 18:51, Alberto Garcia wrote: On Mon 03 May 2021 01:33:57 PM CEST, Vladimir Sementsov-Ogievskiy wrote: @@ -2918,12 +2918,18 @@ BdrvChild *bdrv_root_attach_child(BlockDriverState *child_bs, child_role, perm, shared_perm, opaque,

Re: [PATCH 2/2] block: Fix Transaction leak in bdrv_reopen_multiple()

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
03.05.2021 14:05, Kevin Wolf wrote: Like other error paths, this one needs to call tran_finalize() and clean up the BlockReopenQueue, too. Fixes: CID 1452772 Fixes: 72373e40fbc7e4218061a8211384db362d3e7348 Signed-off-by: Kevin Wolf --- block.c | 2 +- 1 file changed, 1 insertion(+), 1

Re: [PATCH 5/6] block: simplify bdrv_child_user_desc()

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
03.05.2021 19:05, Alberto Garcia wrote: On Mon 03 May 2021 01:34:01 PM CEST, Vladimir Sementsov-Ogievskiy wrote: All existing parent types (block nodes, block devices, jobs) has the realization. So, drop unreachable code. Signed-off-by: Vladimir Sementsov-Ogievskiy With the updated

Re: [PATCH 2/6] block: bdrv_reopen_multiple(): fix leak of tran object

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
03.05.2021 18:52, Alberto Garcia wrote: On Mon 03 May 2021 01:33:58 PM CEST, Vladimir Sementsov-Ogievskiy wrote: We have one path, where tran object is created, but we don't touch and don't free it in any way: "goto cleanup" in first loop with calls to bdrv_flush(). Fix it simply moving

Re: [PATCH 0/2] block: Fix Transaction leaks

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
03.05.2021 14:05, Kevin Wolf wrote: These are two follow-up fixes for Vladimir's "block: update graph permissions update". The bugs were reported by Coverity. Kevin Wolf (2): block: Fix Transaction leak in bdrv_root_attach_child() block: Fix Transaction leak in bdrv_reopen_multiple()

Re: [PATCH 2/2] block: Fix Transaction leak in bdrv_reopen_multiple()

2021-05-04 Thread Vladimir Sementsov-Ogievskiy
03.05.2021 17:33, Kevin Wolf wrote: Am 03.05.2021 um 15:09 hat Vladimir Sementsov-Ogievskiy geschrieben: 03.05.2021 15:41, Kevin Wolf wrote: Am 03.05.2021 um 13:40 hat Vladimir Sementsov-Ogievskiy geschrieben: 03.05.2021 14:05, Kevin Wolf wrote: Like other error paths, this one needs to call