Re: [PATCH v6 11/14] block/core: add generic infrastructure for x-blockdev-amend qmp command

2020-05-14 Thread Max Reitz
On 10.05.20 15:40, Maxim Levitsky wrote: > blockdev-amend will be used similiar to blockdev-create > to allow on the fly changes of the structure of the format based block > devices. > > Current plan is to first support encryption keyslot management for luks > based formats (raw and embedded in q

Re: [PATCH v6 07/14] block/crypto: implement the encryption key management

2020-05-14 Thread Max Reitz
On 14.05.20 16:14, Daniel P. Berrangé wrote: > On Thu, May 14, 2020 at 04:09:59PM +0200, Max Reitz wrote: >> On 10.05.20 15:40, Maxim Levitsky wrote: >>> This implements the encryption key management using the generic code in >>> qcrypto layer and exposes it to the use

Re: [PATCH v6 09/14] iotests: filter few more luks specific create options

2020-05-14 Thread Max Reitz
On 10.05.20 15:40, Maxim Levitsky wrote: > This allows more tests to be able to have same output on both qcow2 luks > encrypted images > and raw luks images > > Signed-off-by: Maxim Levitsky > Reviewed-by: Daniel P. Berrangé > --- > tests/qemu-iotests/087.out | 6 ++--- > tests/qemu-iot

Re: [PATCH v6 08/14] block/qcow2: extend qemu-img amend interface with crypto options

2020-05-14 Thread Max Reitz
100644 > --- a/block/qcow2.c > +++ b/block/qcow2.c [...] > @@ -4744,17 +4757,11 @@ static BlockMeasureInfo *qcow2_measure(QemuOpts > *opts, BlockDriverState *in_bs, > g_free(optstr); > > if (has_luks) { > + Why? With this line dropped, and 082.out fixed up: R

Re: [PATCH v6 07/14] block/crypto: implement the encryption key management

2020-05-14 Thread Max Reitz
-img info. Do we really care if someone edits the key slots while qemu-img info is processing? OTOH, I don’t think it’ll harm much. Well, apart from the fact that BDRV_O_NO_IO won’t do much for LUKS images. *shrug* Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

Re: [PATCH v6 05/14] block/amend: refactor qcow2 amend options

2020-05-14 Thread Max Reitz
On 10.05.20 15:40, Maxim Levitsky wrote: > Some qcow2 create options can't be used for amend. > Remove them from the qcow2 create options and add generic logic to detect > such options in qemu-img > > Signed-off-by: Maxim Levitsky > Reviewed-by: Daniel P. Berrangé > --- > block/qcow2.c

Re: [PATCH v6 04/14] block/amend: separate amend and create options for qemu-img

2020-05-14 Thread Max Reitz
{ /* end of list */ } If QCOW_COMMON_OPTIONS were to already end in a comma (which I think it should), then it would become superfluous here. > } > }; [...] > diff --git a/include/block/block_int.h b/include/block/block_int.h > index 952b2f033a..0a71357b50 100644 > --- a/include/block/block_int.h > +++ b/include/block/block_int.h > @@ -412,6 +412,10 @@ struct BlockDriver { > > /* List of options for creating images, terminated by name == NULL */ > QemuOptsList *create_opts; > + > +/* List of options for image amend*/ I don’t suppose we have a coding style requirement for this, but I still think there should be a space before the closing asterisk. With those things fixed: Reviewed-by: Max Reitz > +QemuOptsList *amend_opts; > + signature.asc Description: OpenPGP digital signature

Re: [PATCH v6 03/14] block/amend: add 'force' option

2020-05-14 Thread Max Reitz
f luks, it allows to > + erase last encryption key, and to overwrite an active encryption key. *erase the last encryption key With that fixed: Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

Re: [PATCH v6 02/14] qcrypto/luks: implement encryption key management

2020-05-14 Thread Max Reitz
On 10.05.20 15:40, Maxim Levitsky wrote: > Next few patches will expose that functionality to the user. > > Signed-off-by: Maxim Levitsky > Reviewed-by: Daniel P. Berrangé > --- > crypto/block-luks.c | 395 +++- > qapi/crypto.json| 61 ++- > 2 fi

Re: [RFC v2] migration: Add migrate-set-bitmap-node-mapping

2020-05-14 Thread Max Reitz
On 13.05.20 22:09, Vladimir Sementsov-Ogievskiy wrote: [...] > 1. So, you decided to make only node-mapping, not bitmap-mapping, so we > can't rename bitmaps in-flight and can't migrate bitmaps from one node > to several and visa-versa. I think it's OK, nothing good in such > possibilities, and thi

Re: [RFC v2] migration: Add migrate-set-bitmap-node-mapping

2020-05-14 Thread Max Reitz
On 14.05.20 10:42, Dr. David Alan Gilbert wrote: > * Max Reitz (mre...@redhat.com) wrote: > > > >> +void qmp_migrate_set_bitmap_node_mapping(MigrationBlockNodeMappingList >> *mapping, >> + Error **errp) >> +{ &

Re: [RFC v2] migration: Add migrate-set-bitmap-node-mapping

2020-05-14 Thread Max Reitz
On 13.05.20 22:09, Vladimir Sementsov-Ogievskiy wrote: > 13.05.2020 17:56, Max Reitz wrote: >> This command allows mapping block node names to aliases for the purpose >> of block dirty bitmap migration. >> >> This way, management tools can use different node names on th

Re: [RFC v2] migration: Add migrate-set-bitmap-node-mapping

2020-05-14 Thread Max Reitz
On 13.05.20 18:11, Eric Blake wrote: > On 5/13/20 9:56 AM, Max Reitz wrote: >> This command allows mapping block node names to aliases for the purpose >> of block dirty bitmap migration. >> >> This way, management tools can use different node names on the source >

[RFC v2] migration: Add migrate-set-bitmap-node-mapping

2020-05-13 Thread Max Reitz
both with arbitrary aliases in the migration stream). Suggested-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Max Reitz --- Branch: https://github.com/XanClic/qemu.git migration-bitmap-mapping-rfc-v2 Branch: https://git.xanclic.moe/XanClic/qemu.git migration-bitmap-mapping-rfc-v2 (Sorry, v1

Re: [RFC] migration: Add migrate-set-bitmap-node-mapping

2020-05-13 Thread Max Reitz
On 13.05.20 16:49, Max Reitz wrote: > This command allows mapping block node names to aliases for the purpose > of block dirty bitmap migration. > > This way, management tools can use different node names on the source > and destination and pass the mapping of how bitmaps are to b

[RFC] migration: Add migrate-set-bitmap-node-mapping

2020-05-13 Thread Max Reitz
both with arbitrary aliases in the migration stream). Suggested-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Max Reitz --- Branch: https://github.com/XanClic/qemu.git migration-bitmap-mapping-rfc Branch: https://git.xanclic.moe/XanClic/qemu.git migration-bitmap-mapping-rfc Vladimir has

[PULL 4/5] iotests: 287: add qcow2 compression type test

2020-05-13 Thread Max Reitz
: <20200507082521.29210-5-dplotni...@virtuozzo.com> Signed-off-by: Max Reitz --- tests/qemu-iotests/287 | 152 + tests/qemu-iotests/287.out | 67 tests/qemu-iotests/group | 1 + 3 files changed, 220 insertions(+) create mode 100755

[PULL 3/5] qcow2: add zstd cluster compression

2020-05-13 Thread Max Reitz
: 1.57 compressed image size in both cases: 1.4G Signed-off-by: Denis Plotnikov QAPI part: Acked-by: Markus Armbruster Message-Id: <20200507082521.29210-4-dplotni...@virtuozzo.com> Signed-off-by: Max Reitz --- docs/interop/qcow2.txt | 1 + configure | 2 +- qapi/block-cor

[PULL 5/5] block/block-copy: fix use-after-free of task pointer

2020-05-13 Thread Max Reitz
ent...@virtuozzo.com> Reviewed-by: Eric Blake Signed-off-by: Max Reitz --- block/block-copy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/block-copy.c b/block/block-copy.c index 03500680f7..4713c8f2a3 100644 --- a/block/block-copy.c +++ b/block/block-copy.c @@ -591,13 +

[PULL 1/5] qcow2: introduce compression type feature

2020-05-13 Thread Max Reitz
182, 185, 198, 206, 242, 255, 274, 280 Signed-off-by: Denis Plotnikov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake Reviewed-by: Max Reitz QAPI part: Acked-by: Markus Armbruster Message-Id: <20200507082521.29210-2-dplotni...@virtuozzo.com> Signed-off-by: Ma

[PULL 0/5] Block patches

2020-05-13 Thread Max Reitz
The following changes since commit d5c75ec500d96f1d93447f990cd5a4ef5ba27fae: Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2020-05-08-1' into staging (2020-05-12 17:00:10 +0100) are available in the Git repository at: https://github.com/XanClic/qemu.git tags/pull-block-2

[PULL 2/5] qcow2: rework the cluster compression routine

2020-05-13 Thread Max Reitz
Reitz Message-Id: <20200507082521.29210-3-dplotni...@virtuozzo.com> Signed-off-by: Max Reitz --- block/qcow2-threads.c | 71 --- 1 file changed, 60 insertions(+), 11 deletions(-) diff --git a/block/qcow2-threads.c b/block/qcow2-threads.c index a681

Re: [PATCH 2/2] iotests: Run pylint and mypy in a testcase

2020-05-13 Thread Max Reitz
on. (And maybe afterwards run all tests again with some custom combinations, but only when that makes sense.) Well. Not a new problem. Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

Re: [PATCH 1/2] iotests: Fix incomplete type declarations

2020-05-13 Thread Max Reitz
.py | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

[PATCH v4 33/34] block: Pass BdrvChildRole in remaining cases

2020-05-13 Thread Max Reitz
These calls have no real use for the child role yet, but it will not harm to give one. Notably, the bdrv_root_attach_child() call in blockjob.c is left unmodified because there is not much the generic BlockJob object wants from its children. Signed-off-by: Max Reitz --- block/block-backend.c

[PATCH v4 29/34] block: Use bdrv_default_perms()

2020-05-13 Thread Max Reitz
-off-by: Max Reitz Reviewed-by: Eric Blake --- block/backup-top.c | 4 ++-- block/blkdebug.c| 4 ++-- block/blklogwrites.c| 9 ++--- block/blkreplay.c | 2 +- block/blkverify.c | 2 +- block/bochs.c | 2 +- block/cloop.c

[PATCH v4 27/34] block: Use child_of_bds in remaining places

2020-05-13 Thread Max Reitz
Replace child_file by child_of_bds in all remaining places (excluding tests). Signed-off-by: Max Reitz --- block.c | 3 ++- block/backup-top.c | 4 ++-- block/blklogwrites.c | 4 ++-- block/raw-format.c | 15 +-- 4 files changed, 19 insertions(+), 7 deletions

[PATCH v4 34/34] block: Drop @child_class from bdrv_child_perm()

2020-05-13 Thread Max Reitz
Implementations should decide the necessary permissions based on @role. Signed-off-by: Max Reitz --- include/block/block_int.h | 4 +--- block.c | 39 +++-- block/backup-top.c | 3 +-- block/blkdebug.c| 3 +-- block

[PATCH v4 32/34] block: Drop child_file

2020-05-13 Thread Max Reitz
Signed-off-by: Max Reitz --- include/block/block_int.h | 1 - block.c | 39 ++- tests/test-bdrv-drain.c | 8 +++- 3 files changed, 5 insertions(+), 43 deletions(-) diff --git a/include/block/block_int.h b/include/block/block_int.h

[PATCH v4 19/34] block: Add bdrv_default_perms()

2020-05-13 Thread Max Reitz
This callback can be used by BDSs that use child_of_bds with the appropriate BdrvChildRole for their children. Also, make bdrv_format_default_perms() use it for child_of_bds children (just a temporary solution until we can drop bdrv_format_default_perms() altogether). Signed-off-by: Max Reitz

[PATCH v4 31/34] block: Drop bdrv_format_default_perms()

2020-05-13 Thread Max Reitz
Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- include/block/block_int.h | 11 --- block.c | 19 --- 2 files changed, 30 deletions(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index 6fc5f0d333..e791c40496 100644 --- a

[PATCH v4 12/34] block: Unify bdrv_child_cb_attach()

2020-05-13 Thread Max Reitz
child_backing.attach that ensures bdrv_backing_attach() is called for all COW children that do not have their role set yet. (Also, move bdrv_child_cb_attach() down to group it with bdrv_inherited_options().) Signed-off-by: Max Reitz --- block.c | 27 --- 1 file changed, 20 insertions

[PATCH v4 30/34] block: Make bdrv_filter_default_perms() static

2020-05-13 Thread Max Reitz
Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- include/block/block_int.h | 10 -- block.c | 17 +++-- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index 0781d43af5..6fc5f0d333

[PATCH v4 24/34] block: Drop child_backing

2020-05-13 Thread Max Reitz
Signed-off-by: Max Reitz --- include/block/block_int.h | 1 - block.c | 60 ++- 2 files changed, 3 insertions(+), 58 deletions(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index 4b09fa1124..0781d43af5 100644 --- a

[PATCH v4 25/34] block: Make format drivers use child_of_bds

2020-05-13 Thread Max Reitz
Commonly, they need to pass the BDRV_CHILD_IMAGE set as the BdrvChildRole; but there are exceptions for drivers with external data files (qcow2 and vmdk). Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block/bochs.c | 4 ++-- block/cloop.c | 4 ++-- block/crypto.c| 4

[PATCH v4 18/34] block: Relax *perms_for_storage for data children

2020-05-13 Thread Max Reitz
(without the path for data children doing anything meaningful). Signed-off-by: Max Reitz --- block.c | 58 +++-- 1 file changed, 48 insertions(+), 10 deletions(-) diff --git a/block.c b/block.c index 5d17aa1cc3..5ff6cbd796 100644 --- a/block.c

[PATCH v4 20/34] raw-format: Split raw_read_options()

2020-05-13 Thread Max Reitz
Split raw_read_options() into one function that actually just reads the options, and another that applies them. This will allow us to detect whether the user has specified any options before attaching the file child (so we can decide on its role based on the options). Signed-off-by: Max Reitz

[PATCH v4 28/34] tests: Use child_of_bds instead of child_file

2020-05-13 Thread Max Reitz
Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- tests/test-bdrv-drain.c | 29 + tests/test-bdrv-graph-mod.c | 6 -- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/tests/test-bdrv-drain.c b/tests/test-bdrv-drain.c index 15393a0140

[PATCH v4 26/34] block: Make filter drivers use child_of_bds

2020-05-13 Thread Max Reitz
("By default" refers to the fact that blkverify's other child (the non-filtered one) will have BDRV_O_PROTOCOL force-unset, because that is what happens for all non-filtered children of non-format drivers.) Signed-off-by: Max Reitz --- block/blkdebug.c| 4 +++- block/b

[PATCH v4 11/34] block: Use bdrv_inherited_options()

2020-05-13 Thread Max Reitz
ves. Thus, such children should inherit BDRV_O_NO_IO. Signed-off-by: Max Reitz --- block.c | 71 +++-- 1 file changed, 19 insertions(+), 52 deletions(-) diff --git a/block.c b/block.c index 9b0e13d537..b3b978a092 100644 --- a/block.c +++ b/block.c

[PATCH v4 22/34] block: Drop child_format

2020-05-13 Thread Max Reitz
Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- include/block/block_int.h | 1 - block.c | 29 - 2 files changed, 30 deletions(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index 3a9dda9be7..4b09fa1124 100644 --- a

[PATCH v4 21/34] block: Switch child_format users to child_of_bds

2020-05-13 Thread Max Reitz
Both users (quorum and blkverify) use child_format for not-really-filtered children, so the appropriate BdrvChildRole in both cases is DATA. (Note that this will cause bdrv_inherited_options() to force-allow format probing.) Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block

[PATCH v4 23/34] block: Make backing files child_of_bds children

2020-05-13 Thread Max Reitz
Make all parents of backing files pass the appropriate BdrvChildRole. By doing so, we can switch their BdrvChildClass over to the generic child_of_bds, which will do the right thing when given a correct BdrvChildRole. Signed-off-by: Max Reitz --- block.c | 26

[PATCH v4 14/34] block: Add child_of_bds

2020-05-13 Thread Max Reitz
will take care of that.) Signed-off-by: Max Reitz --- include/block/block_int.h | 1 + block.c | 24 2 files changed, 25 insertions(+) diff --git a/include/block/block_int.h b/include/block/block_int.h index 6245d8a18d..54df821d61 100644 --- a/include

[PATCH v4 13/34] block: Unify bdrv_child_cb_detach()

2020-05-13 Thread Max Reitz
child_backing.detach that ensures bdrv_backing_detach() is called for all COW children that do not have their role set yet. (Also, move bdrv_child_cb_detach() down to group it with bdrv_inherited_options() and bdrv_child_cb_attach().) Signed-off-by: Max Reitz --- block.c | 27 --- 1

[PATCH v4 00/34] block: Introduce real BdrvChildRole

2020-05-13 Thread Max Reitz
bdrv_default_perms()' 030/34:[] [--] 'block: Make bdrv_filter_default_perms() static' 031/34:[0004] [FC] 'block: Drop bdrv_format_default_perms()' 032/34:[0013] [FC] 'block: Drop child_file' 033/34:[0004] [FC] 'block: Pass BdrvChildRole in remaining cases'

[PATCH v4 15/34] block: Distinguish paths in *_format_default_perms

2020-05-13 Thread Max Reitz
bdrv_format_default_perms() has one code path for backing files, and one for storage files. We want to pull them out into own functions, so make sure they are completely distinct before so the next patches will be a bit cleaner. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block.c

[PATCH v4 17/34] block: Pull out bdrv_default_perms_for_storage()

2020-05-13 Thread Max Reitz
each such role. Note that bdrv_default_perms_for_storage() currently handles all DATA | METADATA children. A follow-up patch is going to split it further into one function for each case. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block.c | 71

[PATCH v4 09/34] block: Rename bdrv_inherited_options()

2020-05-13 Thread Max Reitz
The other two .inherit_options implementations specify exactly for what case they are used in their name, so do it for this one as well. (The actual intention behind this patch is to follow it up with a generic bdrv_inherited_options() that works for all three cases.) Signed-off-by: Max Reitz

[PATCH v4 07/34] block: Pass BdrvChildRole to .inherit_options()

2020-05-13 Thread Max Reitz
For now, all callers (effectively) pass 0 and no callee evaluates thie value. Later patches will change both. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- include/block/block_int.h | 3 ++- block.c | 40 +++ block/block-backend.c

[PATCH v4 16/34] block: Pull out bdrv_default_perms_for_cow()

2020-05-13 Thread Max Reitz
each such role. Signed-off-by: Max Reitz --- block.c | 62 + 1 file changed, 40 insertions(+), 22 deletions(-) diff --git a/block.c b/block.c index b3e7ae70c7..b1a471 100644 --- a/block.c +++ b/block.c @@ -2468,6 +2468,44 @@ void

[PATCH v4 10/34] block: Add generic bdrv_inherited_options()

2020-05-13 Thread Max Reitz
implementations can fall back to it just by passing appropriate BdrvChildRole and parent_is_format values. Signed-off-by: Max Reitz --- block.c | 81 + 1 file changed, 81 insertions(+) diff --git a/block.c b/block.c index a17c29f54b..9b0e13d537

[PATCH v4 05/34] block: Add BdrvChildRole to BdrvChild

2020-05-13 Thread Max Reitz
For now, it is always set to 0. Later patches in this series will ensure that all callers pass an appropriate combination of flags. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- include/block/block.h | 2 ++ include/block/block_int.h | 2 ++ block.c | 11

[PATCH v4 08/34] block: Pass parent_is_format to .inherit_options()

2020-05-13 Thread Max Reitz
want format probing if the parent is a format node already (except for the backing chain)). Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- include/block/block_int.h | 2 +- block.c | 37 +++-- block/block-backend.c | 2 +- block

[PATCH v4 04/34] block: Add BdrvChildRole and BdrvChildRoleBits

2020-05-13 Thread Max Reitz
This mask will supplement BdrvChildClass when it comes to what role (or combination of roles) a child takes for its parent. It consists of BdrvChildRoleBits values (which is an enum). Because empty enums are not allowed, let us just start with it filled. Signed-off-by: Max Reitz --- include

[PATCH v4 06/34] block: Pass BdrvChildRole to bdrv_child_perm()

2020-05-13 Thread Max Reitz
For now, all callers pass 0 and no callee evaluates this value. Later patches will change both. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- include/block/block_int.h | 5 - block.c | 22 -- block/backup-top.c | 3 ++- block

[PATCH v4 02/34] block: Add BlockDriver.is_format

2020-05-13 Thread Max Reitz
something on which to distinguish format drivers from others, and hence this flag. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia --- include/block/block_int.h | 7 +++ block/bochs.c | 1 + block/cloop.c | 1 + block/crypto.c

[PATCH v4 03/34] block: Rename BdrvChildRole to BdrvChildClass

2020-05-13 Thread Max Reitz
role. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia --- include/block/block.h | 6 +- include/block/block_int.h | 22 +++--- block.c | 142 ++-- block/backup-top.c | 8 +- block/blkde

[PATCH v4 01/34] block: Mark commit, mirror, blkreplay as filters

2020-05-13 Thread Max Reitz
The commit, mirror, and blkreplay block nodes are filters, so they should be marked as such. Signed-off-by: Max Reitz --- block/blkreplay.c | 1 + block/commit.c| 2 ++ block/mirror.c| 2 ++ 3 files changed, 5 insertions(+) diff --git a/block/blkreplay.c b/block/blkreplay.c index

Re: [PATCH v3 7/9] qcow2: Expose bitmaps' size during measure

2020-05-13 Thread Max Reitz
On 12.05.20 21:39, Eric Blake wrote: > On 5/12/20 6:10 AM, Max Reitz wrote: > > >>> This does not break old code since previously we always reported only >>> guest visible content >>> here, but it changes the semantics, and now you cannot allocate >>&

Re: [PATCH v3 7/9] qcow2: Expose bitmaps' size during measure

2020-05-12 Thread Max Reitz
On 12.05.20 12:17, Nir Soffer wrote: > On Fri, May 8, 2020 at 9:03 PM Eric Blake wrote: >> >> It's useful to know how much space can be occupied by qcow2 persistent >> bitmaps, even though such metadata is unrelated to the guest-visible >> data. Report this value as an additional field, present w

Re: [PATCH v3 6/9] qemu-img: Add bitmap sub-command

2020-05-11 Thread Max Reitz
On 11.05.20 20:22, Eric Blake wrote: > On 5/11/20 6:10 AM, Max Reitz wrote: >> On 08.05.20 20:03, Eric Blake wrote: >>> Include actions for --add, --remove, --clear, --enable, --disable, and >>> --merge (note that --clear is a bit of fluff, because the same can be >

Re: [PATCH v3 3/9] block: Make it easier to learn which BDS support bitmaps

2020-05-11 Thread Max Reitz
On 11.05.20 20:16, Eric Blake wrote: > On 5/11/20 4:21 AM, Max Reitz wrote: >> On 08.05.20 20:03, Eric Blake wrote: >>> Upcoming patches will enhance bitmap support in qemu-img, but in doing >>> so, it turns out to be nice to suppress output when bitmaps make no >&

Re: [PATCH v2 4/4] iotests: Mirror with different source/target size

2020-05-11 Thread Max Reitz
20200507145228.323412-4-kw...@redhat.com> > Reviewed-by: Eric Blake > Signed-off-by: Kevin Wolf > --- > tests/qemu-iotests/041 | 45 ++ > tests/qemu-iotests/041.out | 4 ++-- > 2 files changed, 47 insertions(+), 2 deletions(-)

Re: [PATCH v2 1/4] iotests/109: Don't mirror with mismatched size

2020-05-11 Thread Max Reitz
On 11.05.20 17:29, Kevin Wolf wrote: > Am 11.05.2020 um 17:08 hat Max Reitz geschrieben: >> On 11.05.20 15:58, Kevin Wolf wrote: >>> This patch makes the raw image the same size as the file in a different >>> format that is mirrored as raw to it to avoid errors when m

Re: [PATCH v2 3/4] mirror: Make sure that source and target size match

2020-05-11 Thread Max Reitz
> Message-Id: <20200507145228.323412-3-kw...@redhat.com> > Reviewed-by: Eric Blake > Signed-off-by: Kevin Wolf > --- > block/mirror.c | 21 - > 1 file changed, 12 insertions(+), 9 deletions(-) Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

Re: [PATCH v2 2/4] iotests/229: Use blkdebug to inject an error

2020-05-11 Thread Max Reitz
(with Message-ID tag and double S-o-b)? (Because I’ve never seen anyone else do it) > --- > tests/qemu-iotests/229 | 15 +++ > tests/qemu-iotests/229.out | 6 +++--- > 2 files changed, 14 insertions(+), 7 deletions(-) Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

Re: [PATCH v2 1/4] iotests/109: Don't mirror with mismatched size

2020-05-11 Thread Max Reitz
On 11.05.20 15:58, Kevin Wolf wrote: > This patch makes the raw image the same size as the file in a different > format that is mirrored as raw to it to avoid errors when mirror starts > to enforce that source and target are the same size. > > We check only that the first 512 bytes are zeroed (ins

Re: [PATCH v3 9/9] iotests: Add test 291 to for qemu-img bitmap coverage

2020-05-11 Thread Max Reitz
> tests/qemu-iotests/291.out | 78 ++ > tests/qemu-iotests/group | 1 + > 3 files changed, 191 insertions(+) > create mode 100755 tests/qemu-iotests/291 > create mode 100644 tests/qemu-iotests/291.out Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

Re: [PATCH v3 8/9] qemu-img: Add convert --bitmaps option

2020-05-11 Thread Max Reitz
d in the > same function: an extra blank line, and merging back-to-back 'if > (!skip_create)' blocks. > > Signed-off-by: Eric Blake > --- > docs/tools/qemu-img.rst | 6 ++- > qemu-img.c | 81 +++-- > qemu-img-cmds.hx

Re: [PATCH v3 7/9] qcow2: Expose bitmaps' size during measure

2020-05-11 Thread Max Reitz
On 08.05.20 20:03, Eric Blake wrote: > It's useful to know how much space can be occupied by qcow2 persistent > bitmaps, even though such metadata is unrelated to the guest-visible > data. Report this value as an additional field, present when > measuring an existing image and the output format su

Re: [PATCH v3 6/9] qemu-img: Add bitmap sub-command

2020-05-11 Thread Max Reitz
284 insertions(+) > > diff --git a/docs/tools/qemu-img.rst b/docs/tools/qemu-img.rst > index 7d08c48d308f..68393c357386 100644 > --- a/docs/tools/qemu-img.rst > +++ b/docs/tools/qemu-img.rst > @@ -281,6 +281,29 @@ Command description: [...] > + Additional options ``-g`` set a no

Re: [PATCH v3 5/9] blockdev: Split off basic bitmap operations for qemu-img

2020-05-11 Thread Max Reitz
lock functions that are to be used by the monitor (and maybe other parties like qemu-img). And the monitor itself would never be placed under block/. So I suppose it does make sense and I have no better suggestion. Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

Re: [PATCH v3 4/9] blockdev: Promote several bitmap functions to non-static

2020-05-11 Thread Max Reitz
+ > blockdev.c| 45 --- > 2 files changed, 30 insertions(+), 27 deletions(-) Reviewed-by: Max Reitz > diff --git a/blockdev.c b/blockdev.c > index b3c840ec0312..fbeb38437869 100644 > --- a/blockdev.c > +++ b/blockdev.c [.

Re: [PATCH v3 3/9] block: Make it easier to learn which BDS support bitmaps

2020-05-11 Thread Max Reitz
On 08.05.20 20:03, Eric Blake wrote: > Upcoming patches will enhance bitmap support in qemu-img, but in doing > so, it turns out to be nice to suppress output when bitmaps make no > sense (such as on a qcow2 v2 image). Add a hook to make this easier > to query. > > In the future, when we improve

Re: [PATCH v3 2/9] qemu-img: Fix stale comments on doc location

2020-05-11 Thread Max Reitz
On 08.05.20 20:03, Eric Blake wrote: > Missed in commit e13c59fa. > > Signed-off-by: Eric Blake > --- > qemu-img.c | 2 +- > qemu-img-cmds.hx | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

Re: [PATCH] block/block-copy: fix use-after-free of task pointer

2020-05-08 Thread Max Reitz
On 07.05.20 20:38, Vladimir Sementsov-Ogievskiy wrote: > Obviously, we should g_free the task after trace point and offset > update. > > Reported-by: Coverity > Fixes: 4ce5dd3e9b5ee0fac18625860eb3727399ee965e > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > > Be free to add Coverity number

Re: backing chain & block status & filters

2020-05-07 Thread Max Reitz
On 28.04.20 16:51, Vladimir Sementsov-Ogievskiy wrote: > 28.04.2020 14:08, Max Reitz wrote: >> On 28.04.20 10:55, Vladimir Sementsov-Ogievskiy wrote: >>> Hi! >>> >>> I wanted to resend my "[PATCH 0/4] fix & merge block_status_above and >

Re: [PATCH v3 09/33] block: Add generic bdrv_inherited_options()

2020-05-07 Thread Max Reitz
On 07.05.20 13:19, Kevin Wolf wrote: > Am 07.05.2020 um 10:49 hat Max Reitz geschrieben: >> On 06.05.20 12:37, Kevin Wolf wrote: >>> Am 18.02.2020 um 13:42 hat Max Reitz geschrieben: >>>> +if (role & BDRV_CHILD_COW) { >>>> +/* backing fi

Re: [PATCH v24 0/4] implement zstd cluster compression method

2020-05-07 Thread Max Reitz
On 07.05.20 10:25, Denis Plotnikov wrote: > v24: >01: add "compression_type" to the tests output [Max] >hopefully, I've found them all. Looks like it from what I can tell. :) Thanks, applied to my block branch: https://git.xanclic.moe/XanClic/qemu/commits/branch/block Max signatu

Re: [PATCH v3 32/33] block: Pass BdrvChildRole in remaining cases

2020-05-07 Thread Max Reitz
On 06.05.20 19:13, Kevin Wolf wrote: > Am 18.02.2020 um 13:42 hat Max Reitz geschrieben: >> These calls have no real use for the child role yet, but it will not >> harm to give one. >> >> Notably, the bdrv_root_attach_child() call in blockjob.c is left >> unmodif

Re: [PATCH v3 26/33] block: Use child_of_bds in remaining places

2020-05-07 Thread Max Reitz
On 06.05.20 19:04, Kevin Wolf wrote: > Am 18.02.2020 um 13:42 hat Max Reitz geschrieben: >> Replace child_file by child_of_bds in all remaining places (excluding >> tests). >> >> Signed-off-by: Max Reitz >> Reviewed-by: Eric Blake > >> diff --git a/bloc

Re: [PATCH v3 22/33] block: Make backing files child_of_bds children

2020-05-07 Thread Max Reitz
On 06.05.20 18:37, Kevin Wolf wrote: > Am 18.02.2020 um 13:42 hat Max Reitz geschrieben: >> Make all parents of backing files pass the appropriate BdrvChildRole. >> By doing so, we can switch their BdrvChildClass over to the generic >> child_of_bds, which will do the rig

Re: [PATCH v3 18/33] block: Add bdrv_default_perms()

2020-05-07 Thread Max Reitz
On 06.05.20 15:47, Kevin Wolf wrote: > Am 18.02.2020 um 13:42 hat Max Reitz geschrieben: >> This callback can be used by BDSs that use child_of_bds with the >> appropriate BdrvChildRole for their children. >> >> Also, make bdrv_format_default_perms() use it for child

Re: [PATCH v3 15/33] block: Pull out bdrv_default_perms_for_backing()

2020-05-07 Thread Max Reitz
On 06.05.20 15:21, Kevin Wolf wrote: > Am 18.02.2020 um 13:42 hat Max Reitz geschrieben: >> Right now, bdrv_format_default_perms() is used by format parents >> (generally). We want to switch to a model where most parents use a >> single BdrvChildClass, which then decides the

Re: [PATCH v3 09/33] block: Add generic bdrv_inherited_options()

2020-05-07 Thread Max Reitz
On 06.05.20 15:11, Kevin Wolf wrote: > Am 06.05.2020 um 12:37 hat Kevin Wolf geschrieben: >> Am 18.02.2020 um 13:42 hat Max Reitz geschrieben: >>> After the series this patch belongs to, we want to have a common >>> BdrvChildClass that encompasses all of ch

Re: [PATCH v3 12/33] block: Unify bdrv_child_cb_detach()

2020-05-07 Thread Max Reitz
On 06.05.20 14:41, Kevin Wolf wrote: > Am 18.02.2020 um 13:42 hat Max Reitz geschrieben: >> Make bdrv_child_cb_detach() call bdrv_backing_detach() for children with >> a COW role (and drop the reverse call from bdrv_backing_detach()), so it >> can be used for any child (w

Re: [PATCH v3 09/33] block: Add generic bdrv_inherited_options()

2020-05-07 Thread Max Reitz
On 06.05.20 12:37, Kevin Wolf wrote: > Am 18.02.2020 um 13:42 hat Max Reitz geschrieben: >> After the series this patch belongs to, we want to have a common >> BdrvChildClass that encompasses all of child_file, child_format, and >> child_backing. Such a single

[PATCH] qcow2: Fix preallocation on block devices

2020-05-05 Thread Max Reitz
ast get a better error message. Note that we cannot preallocate block devices on truncate by design, because we do not know what area to preallocate. Their length is always the same, the truncate operation does not change it. Signed-off-by: Max Reitz --- block/qcow2.c | 10 -- 1 fi

Re: [PATCH v3 03/33] block: Add BdrvChildRole and BdrvChildRoleBits

2020-05-05 Thread Max Reitz
On 05.05.20 14:54, Kevin Wolf wrote: > Am 05.05.2020 um 13:59 hat Max Reitz geschrieben: >> On 05.05.20 13:19, Kevin Wolf wrote: >>> Am 18.02.2020 um 13:42 hat Max Reitz geschrieben: [...] >>>> +/* Useful combination of flags */ >>>> +

[PULL 24/24] block/block-copy: use aio-task-pool API

2020-05-05 Thread Max Reitz
tasks. For now used only to keep information about first error: is it read or not. - convert block_copy_dirty_clusters to aio-task loop. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20200429130847.28124-6-vsement...@virtuozzo.com> Signed-off-by: Max Reitz --- block/block-c

[PULL 23/24] block/block-copy: refactor task creation

2020-05-05 Thread Max Reitz
a instead of looping through all non-dirty clusters. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-Id: <20200429130847.28124-5-vsement...@virtuozzo.com> Signed-off-by: Max Reitz --- block/block-copy.c | 80 ++ 1 file cha

[PULL 21/24] block/block-copy: alloc task on each iteration

2020-05-05 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy We are going to use aio-task-pool API, so tasks will be handled in parallel. We need therefore separate allocated task on each iteration. Introduce this logic now. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-Id

[PULL 16/24] qcow2: Allow resize of images with internal snapshots

2020-05-05 Thread Max Reitz
ed control over detecting the first failure than what they get by letting qemu decide how to sequence multiple changes. Signed-off-by: Eric Blake Reviewed-by: Max Reitz Message-Id: <20200428192648.749066-3-ebl...@redhat.com> Signed-off-by: Max Reitz --- block/qcow2-snapshot.c | 20 ++

[PULL 22/24] block/block-copy: add state pointer to BlockCopyTask

2020-05-05 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy We are going to use aio-task-pool API, so we'll need state pointer in BlockCopyTask anyway. Add it now and use where possible. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-Id: <20200429130847.28124-4-vsement...@virtu

[PULL 20/24] block/block-copy: rename in-flight requests to tasks

2020-05-05 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy We are going to use aio-task-pool API and extend in-flight request structure to be a successor of AioTask, so rename things appropriately. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-Id: <20200429130847.28124-2-vsem

[PULL 19/24] Fix iotest 153

2020-05-05 Thread Max Reitz
053c0c31fa45aff Signed-off-by: Maxim Levitsky Message-Id: <20200504131959.9533-1-mlevi...@redhat.com> Signed-off-by: Max Reitz --- tests/qemu-iotests/153 | 2 +- tests/qemu-iotests/153.out | 12 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/qemu-

[PULL 14/24] iotests: use python logging for iotests.log()

2020-05-05 Thread Max Reitz
rg/project/logging_tree/ for more information. Signed-off-by: John Snow Reviewed-by: Max Reitz Message-Id: <2020033114.11581-15-js...@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Max Reitz --- tests/qemu-iotests/030| 4 +-- tests/qemu-iotests/155| 2 +- tests/qemu-iotests

[PULL 11/24] iotests: add script_initialize

2020-05-05 Thread Max Reitz
From: John Snow Like script_main, but doesn't require a single point of entry. Replace all existing initialization sections with this drop-in replacement. This brings debug support to all existing script-style iotests. Signed-off-by: John Snow Reviewed-by: Max Reitz Messa

[PULL 15/24] block: Add blk_new_with_bs() helper

2020-05-05 Thread Max Reitz
From: Eric Blake There are several callers that need to create a new block backend from an existing BDS; make the task slightly easier with a common helper routine. Suggested-by: Max Reitz Signed-off-by: Eric Blake Message-Id: <20200424190903.522087-2-ebl...@redhat.com> [mreitz: Set @re

<    11   12   13   14   15   16   17   18   19   20   >