Skip to contentSkip to conversation

qemu-img: Document --force-share / -U

PATCH Superseded Fam Zheng 6 participants 11 messages Dec 26, 2017 – Jan 30, 2018

v5 of 7 Superseded Latest is v7 →

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

v5 cover qemu-img: Document --force-share / -U

v5: Clean up the @table @var section first. [Kevin, Peter]

Fam Zheng (2):
qemu-img.texi: Clean up parameter list
qemu-img: Document --force-share / -U

 qemu-img.texi | 75 ++++++++++++++++++++++++++++++++++++++---------------------
 1 file changed, 48 insertions(+), 27 deletions(-)
Signature · 1 line
2.14.3
author
#1 lore raw

PATCH v5 1/2 qemu-img.texi: Clean up parameter list

Split options out of the "@table @var" section and create a "@table @option", then use whitespaces and blank lines consistently.

---
 qemu-img.texi | 66 +++++++++++++++++++++++++++++++++++------------------------
 1 file changed, 39 insertions(+), 27 deletions(-)
qemu-img.texi +39 -27
index fdcf120f36..60a0e080c6 100644
@@ -33,38 +33,14 @@ The following commands are supported:
 
 Command parameters:
 @table @var
+
 @item filename
- is a disk image filename
-
-@item --object @var{objectdef}
-
-is a QEMU user creatable object definition. See the @code{qemu(1)} manual
-page for a description of the object properties. The most common object
-type is a @code{secret}, which is used to supply passwords and/or encryption
-keys.
-
-@item --image-opts
-
-Indicates that the source @var{filename} parameter is to be interpreted as a
-full option string, not a plain filename. This parameter is mutually
-exclusive with the @var{-f} parameter.
-
-@item --target-image-opts
-
-Indicates that the @var{output_filename} parameter(s) are to be interpreted as
-a full option string, not a plain filename. This parameter is mutually
-exclusive with the @var{-O} parameters. It is currently required to also use
-the @var{-n} parameter to skip image creation. This restriction may be relaxed
-in a future release.
+is a disk image filename
 
 @item fmt
 is the disk image format. It is guessed automatically in most cases. See below
 for a description of the supported disk formats.
 
-@item --backing-chain
-will enumerate information about backing files in a disk image chain. Refer
-below for further description.
-
 @item size
 is the disk image size in bytes. Optional suffixes @code{k} or @code{K}
 (kilobyte, 1024) @code{M} (megabyte, 1024k) and @code{G} (gigabyte, 1024M)
@@ -74,42 +50,78 @@ and T (terabyte, 1024G) are supported.  @code{b} is ignored.
 is the destination disk image filename
 
 @item output_fmt
- is the destination format
+is the destination format
+
 @item options
 is a comma separated list of format specific options in a
 name=value format. Use @code{-o ?} for an overview of the options supported
 by the used format or see the format descriptions below for details.
+
 @item snapshot_param
 is param used for internal snapshot, format is
 'snapshot.id=[ID],snapshot.name=[NAME]' or '[ID_OR_NAME]'
+
 @item snapshot_id_or_name
 is deprecated, use snapshot_param instead
 
+@end table
+
+@table @option
+
+@item --object @var{objectdef}
+is a QEMU user creatable object definition. See the @code{qemu(1)} manual
+page for a description of the object properties. The most common object
+type is a @code{secret}, which is used to supply passwords and/or encryption
+keys.
+
+@item --image-opts
+Indicates that the source @var{filename} parameter is to be interpreted as a
+full option string, not a plain filename. This parameter is mutually
+exclusive with the @var{-f} parameter.
+
+@item --target-image-opts
+Indicates that the @var{output_filename} parameter(s) are to be interpreted as
+a full option string, not a plain filename. This parameter is mutually
+exclusive with the @var{-O} parameters. It is currently required to also use
+the @var{-n} parameter to skip image creation. This restriction may be relaxed
+in a future release.
+
+@item --backing-chain
+will enumerate information about backing files in a disk image chain. Refer
+below for further description.
+
 @item -c
 indicates that target image must be compressed (qcow format only)
+
 @item -h
 with or without a command shows help and lists the supported formats
+
 @item -p
 display progress bar (compare, convert and rebase commands only).
 If the @var{-p} option is not used for a command that supports it, the
 progress is reported when the process receives a @code{SIGUSR1} or
 @code{SIGINFO} signal.
+
 @item -q
 Quiet mode - do not print any output (except errors). There's no progress bar
 in case both @var{-q} and @var{-p} options are used.
+
 @item -S @var{size}
 indicates the consecutive number of bytes that must contain only zeros
 for qemu-img to create a sparse image during conversion. This value is rounded
 down to the nearest 512 bytes. You may use the common size suffixes like
 @code{k} for kilobytes.
+
 @item -t @var{cache}
 specifies the cache mode that should be used with the (destination) file. See
 the documentation of the emulator's @code{-drive cache=...} option for allowed
 values.
+
 @item -T @var{src_cache}
 specifies the cache mode that should be used with the source file(s). See
 the documentation of the emulator's @code{-drive cache=...} option for allowed
 values.
+
 @end table
 
 Parameters to snapshot subcommand:
Signature · 1 line
2.14.3
Reviewed-by on v5 1/2
#2 lore raw

Re: [Qemu-devel] [PATCH v5 1/2] qemu-img.texi: Clean up parameter list

Quoted 8 lines · Fam Zheng

Split options out of the "@table @var" section and create a "@table @option", then use whitespaces and blank lines consistently.

---
 qemu-img.texi | 66 +++++++++++++++++++++++++++++++++++------------------------
 1 file changed, 39 insertions(+), 27 deletions(-)
Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
Reviewed-by on v5 1/2
#3 lore raw

Re: [Qemu-devel] [PATCH v5 1/2] qemu-img.texi: Clean up parameter list

In reply to Fam Zheng
Quoted 8 lines · Fam Zheng

Split options out of the "@table @var" section and create a "@table @option", then use whitespaces and blank lines consistently.

---
 qemu-img.texi | 66 +++++++++++++++++++++++++++++++++++------------------------
 1 file changed, 39 insertions(+), 27 deletions(-)

[...]

Signature · 1 line
/kashyap
author
#4 lore raw

PATCH v5 2/2 qemu-img: Document --force-share / -U

In reply to Fam Zheng
---
 qemu-img.texi | 9 +++++++++
 1 file changed, 9 insertions(+)
qemu-img.texi +9 -0
index 60a0e080c6..e83e140f7a 100644
@@ -86,6 +86,15 @@ exclusive with the @var{-O} parameters. It is currently required to also use
 the @var{-n} parameter to skip image creation. This restriction may be relaxed
 in a future release.
 
+@item --force-share (-U)
+
+If specified, @code{qemu-img} will open the image with shared permissions,
+which makes it less likely to conflict with a running guest's permissions due
+to image locking. For example, this can be used to get the image information
+(with 'info' subcommand) when the image is used by a running guest. Note that
+this could produce inconsistent results because of concurrent metadata changes,
+etc. This option is only allowed when opening images in read-only mode.
+
 @item --backing-chain
 will enumerate information about backing files in a disk image chain. Refer
 below for further description.
Signature · 1 line
2.14.3
#5 lore raw
Quoted 13 lines · Fam Zheng
---
 qemu-img.texi | 9 +++++++++
 1 file changed, 9 insertions(+)
qemu-img.texi +0 -0
index 60a0e080c6..e83e140f7a 100644

qemu-img.texi exclusive with the @var{-O} parameters. It is currently required to also use · line 90

Quoted 5 lines
qemu-img.texi +2 -0
@@ -86,6 +86,15 @@ exclusive with the @var{-O} parameters. It is currently required to also use
 the @var{-n} parameter to skip image creation. This restriction may be relaxed
 in a future release.
 
+@item --force-share (-U)
+

So the previous patch makes the use of blank lines consistent and this one breaks it again? :-)

qemu-img.texi exclusive with the @var{-O} parameters. It is currently required to also use · line 96

Quoted 6 lines
qemu-img.texi +6 -0
+If specified, @code{qemu-img} will open the image with shared permissions,
+which makes it less likely to conflict with a running guest's permissions due
+to image locking. For example, this can be used to get the image information
+(with 'info' subcommand) when the image is used by a running guest. Note that
+this could produce inconsistent results because of concurrent metadata changes,
+etc. This option is only allowed when opening images in read-only mode.

I personally don't quite like the "makes it less likely to conflict", because that makes it sound like qemu would be stupid and need a nudge in the right direction -- when it's actually the user who does something a bit risky (and qemu is right in forbidding it by default). But since it's only a read-only thing, I won't actually object to it.

(Maybe it should document more exactly what's happening, i.e. that this option will allow concurrent writers (as a standard user, I wouldn't know what "shared permissions" is supposed to mean).)

Max

Quoted 5 lines
qemu-img.texi +1 -0
+
 @item --backing-chain
 will enumerate information about backing files in a disk image chain. Refer
 below for further description.
#6 lore raw
Quoted 1 line · Max Reitz

On 2017-12-26 03:52, Fam Zheng wrote:

[...]

Quoted 16 lines

So the previous patch makes the use of blank lines consistent and this one breaks it again? :-)

qemu-img.texi exclusive with the @var{-O} parameters. It is currently required to also use · line 96

Quoted 6 lines
qemu-img.texi +6 -0
+If specified, @code{qemu-img} will open the image with shared permissions,
+which makes it less likely to conflict with a running guest's permissions due
+to image locking. For example, this can be used to get the image information
+(with 'info' subcommand) when the image is used by a running guest. Note that
+this could produce inconsistent results because of concurrent metadata changes,
+etc. This option is only allowed when opening images in read-only mode.

I personally don't quite like the "makes it less likely to conflict", because that makes it sound like qemu would be stupid and need a nudge in the right direction -- when it's actually the user who does something a bit risky (and qemu is right in forbidding it by default). But since it's only a read-only thing, I won't actually object to it.

Quoted 3 lines

(Maybe it should document more exactly what's happening, i.e. that this option will allow concurrent writers (as a standard user, I wouldn't know what "shared permissions" is supposed to mean).)

Eerie -- Although I reviewed it, I was just mulling over this wording yesterday (while I was tweaking the wording of '--force-share' on a slide for a public conference).

Indeed, "concurrent writers" is much clearer.

[...]

Signature · 1 line
/kashyap
author
#7 lore raw
In reply to Max Reitz
Quoted 17 lines · Max Reitz
Quoted 16 lines · Fam Zheng
---
 qemu-img.texi | 9 +++++++++
 1 file changed, 9 insertions(+)
qemu-img.texi +0 -0
index 60a0e080c6..e83e140f7a 100644
@@ -86,6 +86,15 @@ exclusive with the @var{-O} parameters. It is currently required to also use
 the @var{-n} parameter to skip image creation. This restriction may be relaxed
 in a future release.
 
Quoted 5 lines

qemu-img.texi exclusive with the @var{-O} parameters. It is currently required to also use · line 90

Quoted 2 lines
qemu-img.texi +2 -0
+@item --force-share (-U)
+

So the previous patch makes the use of blank lines consistent and this one breaks it again? :-)

Good point, will fix.

Quoted 14 lines

qemu-img.texi exclusive with the @var{-O} parameters. It is currently required to also use · line 96

Quoted 7 lines
qemu-img.texi +6 -0
+If specified, @code{qemu-img} will open the image with shared permissions,
+which makes it less likely to conflict with a running guest's permissions due
+to image locking. For example, this can be used to get the image information
+(with 'info' subcommand) when the image is used by a running guest. Note that
+this could produce inconsistent results because of concurrent metadata changes,
+etc. This option is only allowed when opening images in read-only mode.

I personally don't quite like the "makes it less likely to conflict", because that makes it sound like qemu would be stupid and need a nudge in the right direction -- when it's actually the user who does something a bit risky (and qemu is right in forbidding it by default). But since it's only a read-only thing, I won't actually object to it.

Quoted 3 lines

(Maybe it should document more exactly what's happening, i.e. that this option will allow concurrent writers (as a standard user, I wouldn't know what "shared permissions" is supposed to mean).)

Makes sense to me. Sending v6.

Fam

Reviewed-by on the v5 series
#8 lore raw
In reply to Fam Zheng
Quoted 12 lines · Fam Zheng

v5: Clean up the @table @var section first. [Kevin, Peter]

Fam Zheng (2):
qemu-img.texi: Clean up parameter list
qemu-img: Document --force-share / -U

 qemu-img.texi | 75 ++++++++++++++++++++++++++++++++++++++---------------------
 1 file changed, 48 insertions(+), 27 deletions(-)
Signature · 1 line
2.14.3
#9 lore raw
In reply to Fam Zheng

Ping?

Quoted 13 lines · Fam Zheng

v5: Clean up the @table @var section first. [Kevin, Peter]

Fam Zheng (2):
qemu-img.texi: Clean up parameter list
qemu-img: Document --force-share / -U

 qemu-img.texi | 75 ++++++++++++++++++++++++++++++++++++++---------------------
 1 file changed, 48 insertions(+), 27 deletions(-)

--
2.14.3

Reviewed-by on the v5 series
#10 lore raw
In reply to Fam Zheng
Quoted 5 lines · Fam Zheng

v5: Clean up the @table @var section first. [Kevin, Peter]

Fam Zheng (2):
qemu-img.texi: Clean up parameter list
qemu-img: Document --force-share / -U

This documentation patch should really be merged, as the '--force-share' was not at all documented when it was released in QEMU 2.10.

Quoted 2 lines

2.14.3

Signature · 1 line
/kashyap