Skip to content

Commit f66afbe

Browse files
berrangekevmw
authored andcommitted
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 <[email protected]> Reviewed-by: Alberto Garcia <[email protected]> Reviewed-by: Eric Blake <[email protected]> Signed-off-by: Kevin Wolf <[email protected]>
1 parent 6473069 commit f66afbe

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

block/qcow2.c

+3
Original file line numberDiff line numberDiff line change
@@ -4069,6 +4069,9 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
40694069
error_report("Changing the encryption format is not supported");
40704070
return -ENOTSUP;
40714071
}
4072+
} else if (g_str_has_prefix(desc->name, "encrypt.")) {
4073+
error_report("Changing the encryption parameters is not supported");
4074+
return -ENOTSUP;
40724075
} else if (!strcmp(desc->name, BLOCK_OPT_CLUSTER_SIZE)) {
40734076
cluster_size = qemu_opt_get_size(opts, BLOCK_OPT_CLUSTER_SIZE,
40744077
cluster_size);

0 commit comments

Comments
 (0)