Re: [PATCH v3 0/3] various: Remove unnecessary casts

2020-05-18 Thread Markus Armbruster
Cédric Le Goater writes: > On 5/18/20 3:17 PM, Markus Armbruster wrote: >> Paolo Bonzini writes: >> >>> On 15/05/20 07:58, Markus Armbruster wrote: Philippe Mathieu-Daudé writes: > Remove unnecessary casts using coccinelle scripts. > > The CPU()/OBJECT() patches don't

Re: [PATCH RFC 01/32] python/qemu: create qemu.lib module

2020-05-18 Thread John Snow
On 5/18/20 3:33 PM, Vladimir Sementsov-Ogievskiy wrote: > 18.05.2020 21:23, John Snow wrote: >> >> >> On 5/18/20 2:14 PM, Vladimir Sementsov-Ogievskiy wrote: >>> 14.05.2020 08:53, John Snow wrote: move python/qemu/*.py to python/qemu/lib/*.py. To create a namespace package, the

Re: [PATCH v7 00/14] LUKS: encryption slot management using amend interface

2020-05-18 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200518122041.10694-1-mlevi...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20200518122041.10694-1-mlevi...@redhat.com Subject: [PATCH v7 00/14] LUKS: encryption slot management

Re: [PATCH RFC v2 5/5] iotests: add 287 for block-dirty-bitmap-populate

2020-05-18 Thread Eric Blake
On 5/13/20 10:49 PM, John Snow wrote: Give block-dirty-bitmap-populate a workout. Signed-off-by: John Snow --- tests/qemu-iotests/287 | 242 ++ tests/qemu-iotests/287.out | 4544 Sheesh, that output file is a workout indeed.

Re: [PATCH RFC v2 3/5] qmp: expose block-dirty-bitmap-populate

2020-05-18 Thread Eric Blake
On 5/13/20 10:49 PM, John Snow wrote: This is a new job-creating command. Signed-off-by: John Snow --- qapi/block-core.json | 18 +++ qapi/transaction.json | 2 ++ blockdev.c| 74 +++ 3 files changed, 94 insertions(+) diff

Re: [PATCH RFC v2 2/5] blockdev: combine DriveBackupState and BlockdevBackupState

2020-05-18 Thread Eric Blake
On 5/13/20 10:49 PM, John Snow wrote: They have the same fields -- rename it BlockJobState. This says BlockJobState... Signed-off-by: John Snow --- blockdev.c | 30 -- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/blockdev.c b/blockdev.c

[PULL 7/7] qemu-img: Add bitmap sub-command

2020-05-18 Thread Eric Blake
Include actions for --add, --remove, --clear, --enable, --disable, and --merge (note that --clear is a bit of fluff, because the same can be accomplished by removing a bitmap and then adding a new one in its place, but it matches what QMP commands exist). Listing is omitted, because it does not

[PULL 5/7] blockdev: Promote several bitmap functions to non-static

2020-05-18 Thread Eric Blake
The next patch will split blockdev.c, which will require accessing some previously-static functions from more than one .c file. But part of promoting a function to public is picking a naming scheme that does not reek of exposing too many internals (two of the three functions were named starting

[PULL 6/7] blockdev: Split off basic bitmap operations for qemu-img

2020-05-18 Thread Eric Blake
Upcoming patches want to add some basic bitmap manipulation abilities to qemu-img. But blockdev.o is too heavyweight to link into qemu-img (among other things, it would drag in block jobs and transaction support - qemu-img does offline manipulation, where atomicity is less important because there

[PULL 3/7] qemu-img: Fix stale comments on doc location

2020-05-18 Thread Eric Blake
Missed in commit e13c59fa. Signed-off-by: Eric Blake Reviewed-by: Max Reitz Message-Id: <20200513011648.166876-3-ebl...@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy --- qemu-img.c | 2 +- qemu-img-cmds.hx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git

[PULL 4/7] block: Make it easier to learn which BDS support bitmaps

2020-05-18 Thread Eric Blake
Upcoming patches will enhance bitmap support in qemu-img, but in doing so, it turns out to be nice to suppress output when persistent bitmaps make no sense (such as on a qcow2 v2 image). Add a hook to make this easier to query. This patch adds a new callback

Re: [PATCH RFC v2 1/5] block: add bitmap-populate job

2020-05-18 Thread Eric Blake
On 5/13/20 10:49 PM, John Snow wrote: This job copies the allocation map into a bitmap. It's a job because there's no guarantee that allocation interrogation will be quick (or won't hang), so it cannot be retrofit into block-dirty-bitmap-merge. retrofitted It was designed with different

Re: [PATCH v3 4/7] migration/block-dirty-bitmap: fix bitmaps pre-blockdev migration during mirror job

2020-05-18 Thread Eric Blake
On 5/15/20 7:40 AM, Vladimir Sementsov-Ogievskiy wrote: Important thing for bitmap migration is to select destination block node to obtain the migrated bitmap. Prepatch, on source we use bdrv_get_device_or_node_name() to identify the node, and on target we do bdrv_lookup_bs.

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

2020-05-18 Thread Vladimir Sementsov-Ogievskiy
18.05.2020 22:17, Eric Blake wrote: On 5/18/20 8:07 AM, Vladimir Sementsov-Ogievskiy wrote: 13.05.2020 04:16, 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

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

2020-05-18 Thread Vladimir Sementsov-Ogievskiy
18.05.2020 22:07, Eric Blake wrote: On 5/18/20 6:42 AM, Vladimir Sementsov-Ogievskiy wrote: 13.05.2020 04:16, 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 accomplished by removing

Re: [PATCH RFC 01/32] python/qemu: create qemu.lib module

2020-05-18 Thread Vladimir Sementsov-Ogievskiy
18.05.2020 21:23, John Snow wrote: On 5/18/20 2:14 PM, Vladimir Sementsov-Ogievskiy wrote: 14.05.2020 08:53, John Snow wrote: move python/qemu/*.py to python/qemu/lib/*.py. To create a namespace package, the 'qemu' directory itself shouldn't have module files in it. Thus, these files will

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

2020-05-18 Thread Eric Blake
On 5/18/20 8:07 AM, Vladimir Sementsov-Ogievskiy wrote: 13.05.2020 04:16, 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 QMP field, present

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

2020-05-18 Thread Eric Blake
On 5/18/20 6:42 AM, Vladimir Sementsov-Ogievskiy wrote: 13.05.2020 04:16, 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 accomplished by removing a bitmap and then adding a new one in

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

2020-05-18 Thread Vladimir Sementsov-Ogievskiy
18.05.2020 21:20, Peter Krempa wrote: On Mon, May 18, 2020 at 20:52:32 +0300, Vladimir Sementsov-Ogievskiy wrote: [add Nikolay] 18.05.2020 19:26, Peter Krempa wrote: On Wed, May 13, 2020 at 16:56:10 +0200, Max Reitz wrote: [...] Is there any difference of handling of persistent and

Re: [PATCH 0/3] iotests: enable logging prior to notrun() invocation

2020-05-18 Thread John Snow
On 5/15/20 5:57 AM, Kevin Wolf wrote: > Am 14.05.2020 um 22:16 hat John Snow geschrieben: >> Hi, you can take just patch 1. > > Thanks, I'm doing that now. > >> patches 2-3 admittedly don't do a whole heck of a lot, because I >> didn't realize that ./check discards *all* output from either

Re: [PATCH v10 14/14] iotests: use python logging for iotests.log()

2020-05-18 Thread John Snow
On 5/15/20 5:03 AM, Kevin Wolf wrote: > Am 14.05.2020 um 21:54 hat John Snow geschrieben: >> >> >> On 5/14/20 6:06 AM, Kevin Wolf wrote: >>> Am 14.05.2020 um 08:24 hat John Snow geschrieben: On 3/31/20 9:44 AM, Kevin Wolf wrote: > Am 31.03.2020 um 02:00 hat John Snow geschrieben:

Re: [PATCH] hw/ide: Make IDEDMAOps handlers take a const IDEDMA pointer

2020-05-18 Thread John Snow
On 5/15/20 4:48 AM, Kevin Wolf wrote: > Am 14.05.2020 um 22:21 hat John Snow geschrieben: >> >> >> On 5/12/20 3:49 PM, Philippe Mathieu-Daudé wrote: >>> Handlers don't need to modify the IDEDMA structure. >>> Make it const. >>> >>> Signed-off-by: Philippe Mathieu-Daudé >> >> I'll trust your

Re: [PATCH RFC 01/32] python/qemu: create qemu.lib module

2020-05-18 Thread John Snow
On 5/18/20 2:14 PM, Vladimir Sementsov-Ogievskiy wrote: > 14.05.2020 08:53, John Snow wrote: >> move python/qemu/*.py to python/qemu/lib/*.py. >> >> To create a namespace package, the 'qemu' directory itself shouldn't >> have module files in it. Thus, these files will go under a 'lib' package

Re: [PATCH v2 5/9] block/io: expand in_flight inc/dec section: simple cases

2020-05-18 Thread Vladimir Sementsov-Ogievskiy
06.05.2020 10:02, Vladimir Sementsov-Ogievskiy wrote: 27.04.2020 17:39, Vladimir Sementsov-Ogievskiy wrote: It's safer to expand in_flight request to start before enter to coroutine in synchronous wrappers, due to the following (theoretical) problem: Consider write. It's possible, that

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

2020-05-18 Thread Peter Krempa
On Mon, May 18, 2020 at 20:52:32 +0300, Vladimir Sementsov-Ogievskiy wrote: > [add Nikolay] > > 18.05.2020 19:26, Peter Krempa wrote: > > On Wed, May 13, 2020 at 16:56:10 +0200, Max Reitz wrote: [...] > > Is there any difference of handling of persistent and non-persistent > > bitmaps?

Re: [PATCH RFC 01/32] python/qemu: create qemu.lib module

2020-05-18 Thread Vladimir Sementsov-Ogievskiy
14.05.2020 08:53, John Snow wrote: move python/qemu/*.py to python/qemu/lib/*.py. To create a namespace package, the 'qemu' directory itself shouldn't have module files in it. Thus, these files will go under a 'lib' package directory instead. Hmm.. On the first glance, it looks better to

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

2020-05-18 Thread Vladimir Sementsov-Ogievskiy
[add Nikolay] 18.05.2020 19:26, Peter Krempa wrote: On Wed, May 13, 2020 at 16:56:10 +0200, 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

Re: [PATCH v4 9/9] iotests: rename and move 169 and 199 tests

2020-05-18 Thread Vladimir Sementsov-Ogievskiy
18.05.2020 19:12, Thomas Huth wrote: On 15/05/2020 23.15, Vladimir Sementsov-Ogievskiy wrote: Rename bitmaps migration tests and move them to tests subdirectory to demonstrate new human-friendly test naming. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/{199 =>

[PULL v2 00/52] Block layer patches

2020-05-18 Thread Kevin Wolf
The following changes since commit debe78ce14bf8f8940c2bdf3ef387505e9e035a9: Merge remote-tracking branch 'remotes/rth/tags/pull-fpu-20200515' into staging (2020-05-15 19:51:16 +0100) are available in the Git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for you to

[PULL 6/6] iotests: Enhance 223 to cover qemu-img map improvements

2020-05-18 Thread Eric Blake
Since qemu-img map + x-dirty-bitmap remains the easiest way to read persistent bitmaps at the moment, it makes a reasonable place to add coverage to ensure we do not regress on the just-added parameters to qemu-img map. Signed-off-by: Eric Blake Message-Id:

[PULL 3/6] qemu-img: validate image length in img_map

2020-05-18 Thread Eric Blake
From: Eyal Moscovici The code handles this case correctly: we merely skip the loop. However it is probably best to return an explicit error. Reviewed-by: Eric Blake Acked-by: Mark Kanda Signed-off-by: Eyal Moscovici Message-Id: <20200513133629.18508-3-eyal.moscov...@oracle.com> [eblake:

[PULL 5/6] qemu-img: Add --start-offset and --max-length to map

2020-05-18 Thread Eric Blake
From: Eyal Moscovici The mapping operation of large disks especially ones stored over a long chain of QCOW2 files can take a long time to finish. Additionally when mapping fails there was no way recover by restarting the mapping from the failed location. The new options, --start-offset and

[PULL 1/6] qemu-nbd: Close inherited stderr

2020-05-18 Thread Eric Blake
From: Raphael Pour Close inherited stderr of the parent if fork_process is false. Otherwise no one will close it. (introduced by e6df58a5) This only affected 'qemu-nbd -c /dev/nbd0'. Signed-off-by: Raphael Pour Message-Id: Reviewed-by: Eric Blake [eblake: Enhance commit message]

[PULL 2/6] qemu_img: add cvtnum_full to print error reports

2020-05-18 Thread Eric Blake
From: Eyal Moscovici All calls to cvtnum check the return value and print the same error message more or less. And so error reporting moved to cvtnum_full to reduce code duplication and provide a single error message. Additionally, cvtnum now wraps cvtnum_full with the existing default range of

[PULL 4/6] qemu-img: refactor dump_map_entry JSON format output

2020-05-18 Thread Eric Blake
From: Eyal Moscovici Previously dump_map_entry identified whether we need to start a new JSON array based on whether start address == 0. In this refactor we remove this assumption as in following patches we will allow map to start from an arbitrary position. Reviewed-by: Eric Blake Acked-by:

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

2020-05-18 Thread Peter Krempa
On Wed, May 13, 2020 at 16:56:10 +0200, 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

Re: [PATCH v4 9/9] iotests: rename and move 169 and 199 tests

2020-05-18 Thread Thomas Huth
On 15/05/2020 23.15, Vladimir Sementsov-Ogievskiy wrote: > Rename bitmaps migration tests and move them to tests subdirectory to > demonstrate new human-friendly test naming. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > tests/qemu-iotests/{199 => tests/migrate-bitmaps-postcopy-test}

Re: [PATCH v7 00/14] LUKS: encryption slot management using amend interface

2020-05-18 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200518122041.10694-1-mlevi...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20200518122041.10694-1-mlevi...@redhat.com Subject: [PATCH v7 00/14] LUKS: encryption slot management

Re: [PATCH RFC v2 0/5] block: add block-dirty-bitmap-populate job

2020-05-18 Thread Peter Krempa
On Wed, May 13, 2020 at 23:49:17 -0400, John Snow wrote: > Hi, > > This is a new (very small) block job that writes a pattern into a > bitmap. The only pattern implemented is the top allocation information. > > This can be used to "recover" an incremental bitmap chain if an external > snapshot

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

2020-05-18 Thread Vladimir Sementsov-Ogievskiy
13.05.2020 04:16, Eric Blake wrote: Add a new test covering the 'qemu-img bitmap' subcommand, as well as 'qemu-img convert --bitmaps', both added in recent patches. Signed-off-by: Eric Blake Reviewed-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/291

Re: [PATCH RFC 00/32] python/qemu: refactor as installable package

2020-05-18 Thread John Snow
On 5/18/20 8:41 AM, Philippe Mathieu-Daudé wrote: > On 5/14/20 7:53 AM, John Snow wrote: > >>    python//qmp.py: use True/False for non/blocking modes >>    python//qmp.py: Define common types >>    python//qmp.py: re-absorb MonitorResponseError >>    python//qmp.py: Do not return None from

Re: [PATCH] hw: Use QEMU_IS_ALIGNED() on parallel flash block size

2020-05-18 Thread Kevin Wolf
Am 11.05.2020 um 22:52 hat Philippe Mathieu-Daudé geschrieben: > Use the QEMU_IS_ALIGNED() macro to verify the flash block size > is properly aligned. It is quicker to process when reviewing. > > Signed-off-by: Philippe Mathieu-Daudé Thanks, applied to the block branch. Kevin

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

2020-05-18 Thread Vladimir Sementsov-Ogievskiy
13.05.2020 04:16, Eric Blake wrote: Make it easier to copy all the persistent bitmaps of (the top layer of) a source image along with its guest-visible contents, by adding a boolean flag for use with qemu-img convert. This is basically shorthand, as the same effect could be accomplished with a

Re: [PATCH v3 0/3] various: Remove unnecessary casts

2020-05-18 Thread Cédric Le Goater
On 5/18/20 3:17 PM, Markus Armbruster wrote: > Paolo Bonzini writes: > >> On 15/05/20 07:58, Markus Armbruster wrote: >>> Philippe Mathieu-Daudé writes: >>> Remove unnecessary casts using coccinelle scripts. The CPU()/OBJECT() patches don't introduce logical change, The

Re: [PATCH v3 0/3] various: Remove unnecessary casts

2020-05-18 Thread Markus Armbruster
Paolo Bonzini writes: > On 15/05/20 07:58, Markus Armbruster wrote: >> Philippe Mathieu-Daudé writes: >> >>> Remove unnecessary casts using coccinelle scripts. >>> >>> The CPU()/OBJECT() patches don't introduce logical change, >>> The DEVICE() one removes various OBJECT_CHECK() calls. >>

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

2020-05-18 Thread Vladimir Sementsov-Ogievskiy
13.05.2020 04:16, 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 QMP field, present when measuring an existing image and output format that

Re: [PATCH] hw: Use QEMU_IS_ALIGNED() on parallel flash block size

2020-05-18 Thread Paolo Bonzini
On 11/05/20 22:52, Philippe Mathieu-Daudé wrote: > Use the QEMU_IS_ALIGNED() macro to verify the flash block size > is properly aligned. It is quicker to process when reviewing. > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/arm/sbsa-ref.c | 2 +- > hw/arm/virt.c | 2 +- >

Re: [PATCH] hw: Use QEMU_IS_ALIGNED() on parallel flash block size

2020-05-18 Thread Peter Maydell
On Mon, 11 May 2020 at 21:52, Philippe Mathieu-Daudé wrote: > > Use the QEMU_IS_ALIGNED() macro to verify the flash block size > is properly aligned. It is quicker to process when reviewing. > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/arm/sbsa-ref.c | 2 +- > hw/arm/virt.c

Re: [PATCH RFC 00/32] python/qemu: refactor as installable package

2020-05-18 Thread Philippe Mathieu-Daudé
On 5/14/20 7:53 AM, John Snow wrote: python//qmp.py: use True/False for non/blocking modes python//qmp.py: Define common types python//qmp.py: re-absorb MonitorResponseError python//qmp.py: Do not return None from cmd_obj python//qmp.py: add casts to JSON deserialization

Re: [PATCH v3 0/3] various: Remove unnecessary casts

2020-05-18 Thread Paolo Bonzini
On 15/05/20 07:58, Markus Armbruster wrote: > Philippe Mathieu-Daudé writes: > >> Remove unnecessary casts using coccinelle scripts. >> >> The CPU()/OBJECT() patches don't introduce logical change, >> The DEVICE() one removes various OBJECT_CHECK() calls. > Queued, thanks! > > Managing

[PATCH v7 14/14] iotests: add tests for blockdev-amend

2020-05-18 Thread Maxim Levitsky
This commit adds two tests that cover the new blockdev-amend functionality of luks and qcow2 driver Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé --- tests/qemu-iotests/295 | 279 + tests/qemu-iotests/295.out | 40 ++

[PATCH v7 13/14] block/qcow2: implement blockdev-amend

2020-05-18 Thread Maxim Levitsky
Currently the implementation only supports amending the encryption options, unlike the qemu-img version Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé Reviewed-by: Max Reitz --- block/qcow2.c| 39 +++ qapi/block-core.json | 16

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

2020-05-18 Thread Maxim Levitsky
Now that we have all the infrastructure in place, wire it in the qcow2 driver and expose this to the user. Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé Reviewed-by: Max Reitz --- block/qcow2.c | 71 +-

[PATCH v7 12/14] block/crypto: implement blockdev-amend

2020-05-18 Thread Maxim Levitsky
Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé Reviewed-by: Max Reitz --- block/crypto.c | 72 qapi/block-core.json | 14 - 2 files changed, 66 insertions(+), 20 deletions(-) diff --git a/block/crypto.c b/block/crypto.c

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

2020-05-18 Thread Maxim Levitsky
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 qcow2) Signed-off-by: Maxim Levitsky Reviewed-by:

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

2020-05-18 Thread Maxim Levitsky
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-iotests/134.out | 2 +- tests/qemu-iotests/158.out

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

2020-05-18 Thread Maxim Levitsky
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 | 138 -- qemu-img.c

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

2020-05-18 Thread Maxim Levitsky
Some options are only useful for creation (or hard to be amended, like cluster size for qcow2), while some other options are only useful for amend, like upcoming keyslot management options for luks Since currently only qcow2 supports amend, move all its options to a common macro and then include

[PATCH v7 06/14] block/crypto: rename two functions

2020-05-18 Thread Maxim Levitsky
rename the write_func to create_write_func, and init_func to create_init_func. This is preparation for other write_func that will be used to update the encryption keys. No functional changes Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé --- block/crypto.c | 25

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

2020-05-18 Thread Maxim Levitsky
'force' option will be used for some unsafe amend operations. This includes things like erasing last keyslot in luks based formats (which destroys the data, unless the master key is backed up by external means), but that _might_ be desired result. Signed-off-by: Maxim Levitsky Reviewed-by:

[PATCH v7 01/14] qcrypto/core: add generic infrastructure for crypto options amendment

2020-05-18 Thread Maxim Levitsky
This will be used first to implement luks keyslot management. block_crypto_amend_opts_init will be used to convert qemu-img cmdline to QCryptoBlockAmendOptions Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé --- block/crypto.c | 17 + block/crypto.h

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

2020-05-18 Thread Maxim Levitsky
Next few patches will expose that functionality to the user. Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé --- crypto/block-luks.c | 416 +++- qapi/crypto.json| 59 ++- 2 files changed, 469 insertions(+), 6 deletions(-) diff

[PATCH v7 00/14] LUKS: encryption slot management using amend interface

2020-05-18 Thread Maxim Levitsky
Hi! Here is the updated series of my patches, incorporating all the feedback I received. This implements the API interface that we agreed upon except that I merged the LUKSKeyslotActive/LUKSKeyslotInactive union into a struct because otherwise I need nested unions which are not supported

[PATCH v7 10/14] iotests: qemu-img tests for luks key management

2020-05-18 Thread Maxim Levitsky
This commit adds two tests, which test the new amend interface of both luks raw images and qcow2 luks encrypted images. Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé --- tests/qemu-iotests/293 | 207 + tests/qemu-iotests/293.out | 99

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

2020-05-18 Thread Maxim Levitsky
This implements the encryption key management using the generic code in qcrypto layer and exposes it to the user via qemu-img This code adds another 'write_func' because the initialization write_func works directly on the underlying file, and amend works on instance of luks device. This commit

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

2020-05-18 Thread Vladimir Sementsov-Ogievskiy
13.05.2020 04:16, 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 accomplished by removing a bitmap and then adding a new one in its place, but it matches what QMP commands exist).

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

2020-05-18 Thread Maxim Levitsky
On Thu, 2020-05-14 at 17:47 +0200, Max Reitz wrote: > 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

Re: [PATCH v2 5/5] vhost: add device started check in migration set log

2020-05-18 Thread Dr. David Alan Gilbert
* Dima Stepanov (dimas...@yandex-team.ru) wrote: > On Mon, May 18, 2020 at 10:50:39AM +0800, Jason Wang wrote: > > > > On 2020/5/16 上午12:54, Dima Stepanov wrote: > > >On Thu, May 14, 2020 at 03:34:24PM +0800, Jason Wang wrote: > > >>On 2020/5/13 下午5:47, Dima Stepanov wrote: > > > case

Re: [PATCH v2 5/5] vhost: add device started check in migration set log

2020-05-18 Thread Dima Stepanov
On Mon, May 18, 2020 at 10:50:39AM +0800, Jason Wang wrote: > > On 2020/5/16 上午12:54, Dima Stepanov wrote: > >On Thu, May 14, 2020 at 03:34:24PM +0800, Jason Wang wrote: > >>On 2020/5/13 下午5:47, Dima Stepanov wrote: > > case CHR_EVENT_CLOSED: > > /* a close event may happen

Re: [PATCH v2 5/5] vhost: add device started check in migration set log

2020-05-18 Thread Dima Stepanov
On Mon, May 18, 2020 at 10:52:08AM +0800, Jason Wang wrote: > > On 2020/5/16 上午11:20, Li Feng wrote: > >Hi, Dima. > >This abort is what I have mentioned in my previous email. > >I have triggered this crash without any fix a week ago. > >And I have written a test patch to let

Re: [PATCH v2 5/5] vhost: add device started check in migration set log

2020-05-18 Thread Dima Stepanov
On Sat, May 16, 2020 at 11:20:03AM +0800, Li Feng wrote: > Hi, Dima. > This abort is what I have mentioned in my previous email. Yes, i understood it and this abort() message was fixed by the previous patch. But since we try new postphone approach this patch isn't working and we need to get the