qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 13/27] qemu-img: Make create hint at protocol options
Date: Tue, 30 Apr 2019 17:42:30 +0200	[thread overview]
Message-ID: <20190430154244.30083-14-kwolf@redhat.com> (raw)
In-Reply-To: <20190430154244.30083-1-kwolf@redhat.com>

From: Max Reitz <mreitz@redhat.com>

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                 | 13 ++++++++++++-
 tests/qemu-iotests/082.out | 20 ++++++++++++++++----
 2 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/qemu-img.c b/qemu-img.c
index d7fe546b85..ddd55ab291 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -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;
 }
 
diff --git a/tests/qemu-iotests/082.out b/tests/qemu-iotests/082.out
index 9a23b68511..7e25706813 100644
--- a/tests/qemu-iotests/082.out
+++ b/tests/qemu-iotests/082.out
@@ -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
 
-- 
2.20.1

  parent reply	other threads:[~2019-04-30 15:43 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-30 15:42 [Qemu-devel] [PULL 00/27] Block layer patches Kevin Wolf
2019-04-30 15:42 ` Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 01/27] tests/qemu-iotests: Fix output of qemu-io related tests Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 02/27] block: Fix AioContext switch for bs->drv == NULL Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 03/27] vpc: unlock Coroutine lock to make IO submit Concurrently Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 04/27] vmdk: Set vmdk parent backing_format to vmdk Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 05/27] block/vhdx: Remove redundant IEC binary prefixes definition Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 06/27] block/vhdx: Use IEC binary prefixes for size constants Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 07/27] cutils: Fix size_to_str() on 32-bit platforms Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 08/27] qemu-img: Saner printing of large file sizes Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 09/27] qcow2: Avoid COW during metadata preallocation Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 10/27] qcow2: Add errp to preallocate_co() Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 11/27] qcow2: Fix full preallocation with external data file Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 12/27] iotests: Perform the correct test in 082 Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 15:42 ` Kevin Wolf [this message]
2019-04-30 15:42   ` [Qemu-devel] [PULL 13/27] qemu-img: Make create hint at protocol options Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 14/27] qcow2: Fix qcow2_make_empty() with external data file Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 15/27] qcow2: Fix error handling in the compression code Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 16/27] block: introduce byte-based io helpers Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 17/27] block/qcow2: use buffer-based io Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 18/27] block/qcow: " Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 19/27] block/qed: " Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 20/27] block/parallels: " Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 21/27] block/backup: " Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 22/27] block/commit: " Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 23/27] block/stream: " Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 24/27] qemu-img: " Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 25/27] commit: Make base read-only if there is an early failure Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 26/27] iotests: Check that images are in read-only mode after block-commit Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 15:42 ` [Qemu-devel] [PULL 27/27] block/qed: add missed coroutine_fn markers Kevin Wolf
2019-04-30 15:42   ` Kevin Wolf
2019-04-30 16:57 ` [Qemu-devel] [PULL 00/27] Block layer patches Peter Maydell
2019-04-30 16:57   ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190430154244.30083-14-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).