summaryrefslogtreecommitdiffstats
path: root/block/qcow2.c
diff options
context:
space:
mode:
authorDaniel P. Berrange2017-11-03 15:39:02 +0100
committerKevin Wolf2017-11-17 13:35:59 +0100
commitf66afbe26f0c093d639610d70d16d7cc3183b652 (patch)
treec0e99bd4c9af4d32a156c60e91f74efdf79814d9 /block/qcow2.c
parentblock: Fix error path in bdrv_backing_update_filename() (diff)
downloadqemu-f66afbe26f0c093d639610d70d16d7cc3183b652.tar.gz
qemu-f66afbe26f0c093d639610d70d16d7cc3183b652.tar.xz
qemu-f66afbe26f0c093d639610d70d16d7cc3183b652.zip
qcow2: don't permit changing encryption parameters
Currently if trying to change encryption parameters on a qcow2 image, qemu-img will abort. We already explicitly check for attempt to change encrypt.format but missed other parameters like encrypt.key-secret. Rather than list each parameter, just blacklist changing of all parameters with a 'encrypt.' prefix. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/qcow2.c')
-rw-r--r--block/qcow2.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index b3d66a0e88..92e5d548e3 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -4069,6 +4069,9 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
error_report("Changing the encryption format is not supported");
return -ENOTSUP;
}
+ } else if (g_str_has_prefix(desc->name, "encrypt.")) {
+ error_report("Changing the encryption parameters is not supported");
+ return -ENOTSUP;
} else if (!strcmp(desc->name, BLOCK_OPT_CLUSTER_SIZE)) {
cluster_size = qemu_opt_get_size(opts, BLOCK_OPT_CLUSTER_SIZE,
cluster_size);