aboutsummaryrefslogtreecommitdiff
path: root/block/qcow.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2018-06-26 19:41:19 +0200
committerKevin Wolf <kwolf@redhat.com>2018-06-29 14:20:56 +0200
commit796d32394516d624986e9275f56bfcbffe945491 (patch)
treefb1c30c32d9da335a8a72a761e9ab130aeb1bebf /block/qcow.c
parent37aec7d75eb0d035a0db4f2cf9ad8b1b0c10f91b (diff)
block/crypto: Simplify block_crypto_{open,create}_opts_init()
block_crypto_open_opts_init() and block_crypto_create_opts_init() contain a virtual visit of QCryptoBlockOptions and QCryptoBlockCreateOptions less member "format", respectively. Change their callers to put member "format" in the QDict, so they can use the generated visitors for these types instead. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/qcow.c')
-rw-r--r--block/qcow.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/block/qcow.c b/block/qcow.c
index 5532731b9f..8546fe5bb7 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -203,9 +203,8 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
ret = -EINVAL;
goto fail;
}
- qdict_del(encryptopts, "format");
- crypto_opts = block_crypto_open_opts_init(
- Q_CRYPTO_BLOCK_FORMAT_QCOW, encryptopts, errp);
+ qdict_put_str(encryptopts, "format", "qcow");
+ crypto_opts = block_crypto_open_opts_init(encryptopts, errp);
if (!crypto_opts) {
ret = -EINVAL;
goto fail;