]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
qemu-img: Make create hint at protocol options
authorMax Reitz <mreitz@redhat.com>
Sat, 13 Apr 2019 15:20:37 +0000 (17:20 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 30 Apr 2019 13:29:00 +0000 (15:29 +0200)
qemu-img create allows giving just a format and "-o help" to get a list
of the options supported by that format.  Users may not realize that the
protocol level may offer even more options, which they only get to see
by specifying a filename.

This patch adds a note to hint at that fact.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-img.c
tests/qemu-iotests/082.out

index d7fe546b85c390b40b9f4f2e78e06901fe2c84bb..ddd55ab29150440b06df491c97bfb3dd20fefa41 100644 (file)
@@ -267,9 +267,20 @@ static int print_block_option_help(const char *filename, const char *fmt)
         create_opts = qemu_opts_append(create_opts, proto_drv->create_opts);
     }
 
-    printf("Supported options:\n");
+    if (filename) {
+        printf("Supported options:\n");
+    } else {
+        printf("Supported %s options:\n", fmt);
+    }
     qemu_opts_print_help(create_opts, false);
     qemu_opts_free(create_opts);
+
+    if (!filename) {
+        printf("\n"
+               "The protocol level may support further options.\n"
+               "Specify the target filename to include those options.\n");
+    }
+
     return 0;
 }
 
index 9a23b6851119e34ffc80ec377346dae635d1f23a..7e2570681354e11a9266b53f3f9235b566b73c35 100644 (file)
@@ -242,7 +242,7 @@ Testing: create -f qcow2 -o backing_file=TEST_DIR/t.qcow2 -o ,, -o help TEST_DIR
 qemu-img: Invalid option list: ,,
 
 Testing: create -f qcow2 -o help
-Supported options:
+Supported qcow2 options:
   backing_file=<str>     - File name of a base image
   backing_fmt=<str>      - Image format of the base image
   cluster_size=<size>    - qcow2 cluster size
@@ -263,10 +263,16 @@ Supported options:
   refcount_bits=<num>    - Width of a reference count entry in bits
   size=<size>            - Virtual disk size
 
+The protocol level may support further options.
+Specify the target filename to include those options.
+
 Testing: create -o help
-Supported options:
+Supported raw options:
   size=<size>            - Virtual disk size
 
+The protocol level may support further options.
+Specify the target filename to include those options.
+
 Testing: create -f bochs -o help
 qemu-img: Format driver 'bochs' does not support image creation
 
@@ -516,7 +522,7 @@ Testing: convert -O qcow2 -o backing_file=TEST_DIR/t.qcow2 -o ,, -o help TEST_DI
 qemu-img: Invalid option list: ,,
 
 Testing: convert -O qcow2 -o help
-Supported options:
+Supported qcow2 options:
   backing_file=<str>     - File name of a base image
   backing_fmt=<str>      - Image format of the base image
   cluster_size=<size>    - qcow2 cluster size
@@ -537,10 +543,16 @@ Supported options:
   refcount_bits=<num>    - Width of a reference count entry in bits
   size=<size>            - Virtual disk size
 
+The protocol level may support further options.
+Specify the target filename to include those options.
+
 Testing: convert -o help
-Supported options:
+Supported raw options:
   size=<size>            - Virtual disk size
 
+The protocol level may support further options.
+Specify the target filename to include those options.
+
 Testing: convert -O bochs -o help
 qemu-img: Format driver 'bochs' does not support image creation