Skip to content

Commit 111fbd7

Browse files
XanClickevmw
authored andcommitted
qemu-img: Unify [-b [-F]] documentation
qemu-img convert documents the backing file and backing format options as follows: [-B backing_file [-F backing_fmt]] whereas qemu-img create has this: [-b backing_file] [-F backing_fmt] That is, for convert, we document that -F cannot be given without -B, while for create, way say that they are independent. Indeed, it is technically possible to give -F without -b, because it is left to the block driver to decide whether this is an error or not, so sometimes it is: $ qemu-img create -f qed -F qed test.qed 64M Formatting 'test.qed', fmt=qed size=67108864 backing_fmt=qed [...] And sometimes it is not: $ qemu-img create -f qcow2 -F qcow2 test.qcow2 64M Formatting 'test.qcow2', fmt=qcow2 cluster_size=65536 [...] qemu-img: test.qcow2: Backing format cannot be used without backing file Generally, it does not make much sense, though, and users should only give -F with -b, so document it that way, as we have already done for qemu-img convert (commit 1899bf4). Reported-by: Tingting Mao <[email protected]> Signed-off-by: Hanna Reitz <[email protected]> Message-Id: <[email protected]> Signed-off-by: Kevin Wolf <[email protected]>
1 parent cb90ec3 commit 111fbd7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/tools/qemu-img.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ Command description:
463463
``--skip-broken-bitmaps`` is also specified to copy only the
464464
consistent bitmaps.
465465

466-
.. option:: create [--object OBJECTDEF] [-q] [-f FMT] [-b BACKING_FILE] [-F BACKING_FMT] [-u] [-o OPTIONS] FILENAME [SIZE]
466+
.. option:: create [--object OBJECTDEF] [-q] [-f FMT] [-b BACKING_FILE [-F BACKING_FMT]] [-u] [-o OPTIONS] FILENAME [SIZE]
467467

468468
Create the new disk image *FILENAME* of size *SIZE* and format
469469
*FMT*. Depending on the file format, you can add one or more *OPTIONS*

qemu-img-cmds.hx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ SRST
5252
ERST
5353

5454
DEF("create", img_create,
55-
"create [--object objectdef] [-q] [-f fmt] [-b backing_file] [-F backing_fmt] [-u] [-o options] filename [size]")
55+
"create [--object objectdef] [-q] [-f fmt] [-b backing_file [-F backing_fmt]] [-u] [-o options] filename [size]")
5656
SRST
57-
.. option:: create [--object OBJECTDEF] [-q] [-f FMT] [-b BACKING_FILE] [-F BACKING_FMT] [-u] [-o OPTIONS] FILENAME [SIZE]
57+
.. option:: create [--object OBJECTDEF] [-q] [-f FMT] [-b BACKING_FILE [-F BACKING_FMT]] [-u] [-o OPTIONS] FILENAME [SIZE]
5858
ERST
5959

6060
DEF("dd", img_dd,

0 commit comments

Comments
 (0)