Skip to content

Make qemu-img/qemu-nbd/qemu-io CLI more flexible

Daniel P. Berrange qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest10 patches 3 repliesIn review
  2. v17 patches 21 repliesSuperseded

Changes in v2 from the cover letter

- Share more common code in qom/object_interfaces.c to avoid duplicating so much of 'object_create' in each command
- Remove previously added '--source optstring' parameter which replaced the positional filenames, in favour of keeping the positional filenames but using a --image-opts boolean arg to change their interpretation
- Added docs for --image-opts to qemu-img man page
- Use printf instead of echo -n in examples
- Line wrap help string based on user terminal width not source code width
- Update qemu-nbd/qemu-io to use constants for options
- Update qemu-nbd to avoid overlapping option values

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10qom: add helpers for UserCreatable object typeshmp.c include/monitor/monitor.h include/qom/object_interfaces.h +3 more+216 -1500 replies
2/10qemu-img: add support for --object command line argqemu-img-cmds.hx qemu-img.c qemu-img.texi+288 -300 replies
3/10qemu-nbd: add support for --object command line argqemu-nbd.c qemu-nbd.texi+59 -00 replies
4/10qemu-io: add support for --object command line argqemu-io.c+53 -00 replies
5/10qemu-io: allow specifying image as a set of options argsqemu-io.c+33 -10 replies
6/10qemu-nbd: allow specifying image as a set of options argsqemu-nbd.c+39 -50 replies
7/10qemu-img: allow specifying image as a set of options argsqemu-img-cmds.hx qemu-img.c qemu-img.texi+303 -510 replies
8/10qemu-nbd: don't overlap long option values with short optionsqemu-nbd.c+6 -61 reply
9/10qemu-nbd: use no_argument/required_argument constantsqemu-nbd.c+24 -231 reply
10/10qemu-io: use no_argument/required_argument constantsqemu-io.c+15 -151 reply

Reviews trailers per patch

3 of 10 patches have a Reviewed-by or Acked-by.

PatchEric Blake
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10R-b
9/10R-b
10/10R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [Qemu-devel] [PATCH v2 00/10] Make qemu-img/qemu-nbd/qemu-io CLI more flexible

This series of patches expands the syntax of the qemu-img, qemu-nbd and qemu-io commands to make them more flexible.

v0: http://lists.gnu.org/archive/html/qemu-devel/2015-10/msg04365.html
v1: https://lists.gnu.org/archive/html/qemu-devel/2015-12/msg04014.html

First all three gain a --object parameter, which allows instantiation of user creatable object types. The immediate use case is to allow for creation of the 'secret' object type to pass passwords for curl, iscsi and rbd drivers. For qemu-nbd this will also be needed to create TLS certificates for encryption support.

Then all three gain a '--image-opts' parameter which causes the positional filenames to be interepreted as option strings rather tha nplain filenames. This avoids the need to use the JSON syntax, or to add custom CLI args for each block backend option that exists. The immediate use case is to allow the user to specify the ID of the 'secret' object they just created.

Changed in v2:

- Share more common code in qom/object_interfaces.c to avoid duplicating so much of 'object_create' in each command
- Remove previously added '--source optstring' parameter which replaced the positional filenames, in favour of keeping the positional filenames but using a --image-opts boolean arg to change their interpretation
- Added docs for --image-opts to qemu-img man page
- Use printf instead of echo -n in examples
- Line wrap help string based on user terminal width not source code width
- Update qemu-nbd/qemu-io to use constants for options
- Update qemu-nbd to avoid overlapping option values

Daniel P. Berrange (10):
qom: add helpers for UserCreatable object types
qemu-img: add support for --object command line arg
qemu-nbd: add support for --object command line arg
qemu-io: add support for --object command line arg
qemu-io: allow specifying image as a set of options args
qemu-nbd: allow specifying image as a set of options args
qemu-img: allow specifying image as a set of options args
qemu-nbd: don't overlap long option values with short options
qemu-nbd: use no_argument/required_argument constants
qemu-io: use no_argument/required_argument constants

 hmp.c                           |  52 +---
 include/monitor/monitor.h       |   3 -
 include/qom/object_interfaces.h |  48 ++++
 qemu-img-cmds.hx                |  44 ++--
 qemu-img.c                      | 570 +++++++++++++++++++++++++++++++++++++---
 qemu-img.texi                   |  14 +
 qemu-io.c                       | 113 +++++++-
 qemu-nbd.c                      | 148 ++++++++---
 qemu-nbd.texi                   |   6 +
 qmp.c                           |  76 +-----
 qom/object_interfaces.c         | 139 ++++++++++
 vl.c                            |  48 +---
 12 files changed, 1008 insertions(+), 253 deletions(-)
Signature · 1 line
2.5.0