aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2021-05-03 14:35:59 -0700
committerKevin Wolf <kwolf@redhat.com>2021-07-09 12:26:05 +0200
commit5a385bf5c5cb3069fab17c014cf4b4f629509f1e (patch)
tree048c44a2cd42c4c0b3ac18a80a5be54620d5011e /block/qcow2.c
parent2842ff2d81ddd86b1d0dd3b98c46b72bfa5cb4cb (diff)
downloadqemu-5a385bf5c5cb3069fab17c014cf4b4f629509f1e.zip
qemu-5a385bf5c5cb3069fab17c014cf4b4f629509f1e.tar.gz
qemu-5a385bf5c5cb3069fab17c014cf4b4f629509f1e.tar.bz2
qcow2: Prohibit backing file changes in 'qemu-img amend'
This was deprecated back in bc5ee6da7 (qcow2: Deprecate use of qemu-img amend to change backing file), and no one in the meantime has given any reasons why it should be supported. Time to make change attempts a hard error (but for convenience, specifying the _same_ backing chain is not forbidden). Update a couple of iotests to match. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20210503213600.569128-2-eblake@redhat.com> Reviewed-by: Connor Kuehl <ckuehl@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/qcow2.c')
-rw-r--r--block/qcow2.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index ee4530c..0cac2ed 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -5620,15 +5620,10 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
if (backing_file || backing_format) {
if (g_strcmp0(backing_file, s->image_backing_file) ||
g_strcmp0(backing_format, s->image_backing_format)) {
- warn_report("Deprecated use of amend to alter the backing file; "
- "use qemu-img rebase instead");
- }
- ret = qcow2_change_backing_file(bs,
- backing_file ?: s->image_backing_file,
- backing_format ?: s->image_backing_format);
- if (ret < 0) {
- error_setg_errno(errp, -ret, "Failed to change the backing file");
- return ret;
+ error_setg(errp, "Cannot amend the backing file");
+ error_append_hint(errp,
+ "You can use 'qemu-img rebase' instead.\n");
+ return -EINVAL;
}
}