]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
qemu-img convert: Deprecate using -n and -o together
authorKevin Wolf <kwolf@redhat.com>
Fri, 9 Aug 2019 09:09:21 +0000 (11:09 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 16 Aug 2019 08:25:16 +0000 (10:25 +0200)
bdrv_create options specified with -o have no effect when skipping image
creation with -n, so this doesn't make sense. Warn against the misuse
and deprecate the combination so we can make it a hard error later.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
qemu-deprecated.texi
qemu-img.c

index fff07bb2a3199970ce398dd097d083ebb8d0c3e1..f7680c08e10a0b0377fc60b21cd723fb8689dce9 100644 (file)
@@ -305,6 +305,13 @@ to just export the entire image and then mount only /dev/nbd0p1 than
 it is to reinvoke @command{qemu-nbd -c /dev/nbd0} limited to just a
 subset of the image.
 
+@subsection qemu-img convert -n -o (since 4.2.0)
+
+All options specified in @option{-o} are image creation options, so
+they have no effect when used with @option{-n} to skip image creation.
+Silently ignored options can be confusing, so this combination of
+options will be made an error in future versions.
+
 @section Build system
 
 @subsection Python 2 support (since 4.1.0)
index 79983772de39e3e2b9f0d425a4043f28f0990716..d9321f6418bbed6a79dd88958710f7fa91472465 100644 (file)
@@ -2231,6 +2231,11 @@ static int img_convert(int argc, char **argv)
         goto fail_getopt;
     }
 
+    if (skip_create && options) {
+        warn_report("-o has no effect when skipping image creation");
+        warn_report("This will become an error in future QEMU versions.");
+    }
+
     s.src_num = argc - optind - 1;
     out_filename = s.src_num >= 1 ? argv[argc - 1] : NULL;