qemu-img: allow qemu-img measure --object without a filename

In most qemu-img sub-commands the --object option only makes sense when
there is a filename.  qemu-img measure is an exception because objects
may be referenced from the image creation options instead of an existing
image file.  Allow --object without a filename.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200221112522.1497712-4-stefanha@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
Stefan Hajnoczi 2020-02-21 11:25:21 +00:00 committed by Max Reitz
parent a9da6e49d8
commit c3673dcf08
4 changed files with 11 additions and 13 deletions

View file

@ -5,10 +5,10 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
qemu-img: Either --size N or one filename must be specified.
qemu-img: --size N cannot be used together with a filename.
qemu-img: At most one filename argument is allowed.
qemu-img: --object, --image-opts, -f, and -l require a filename argument.
qemu-img: --object, --image-opts, -f, and -l require a filename argument.
qemu-img: --object, --image-opts, -f, and -l require a filename argument.
qemu-img: --object, --image-opts, -f, and -l require a filename argument.
qemu-img: Either --size N or one filename must be specified.
qemu-img: --image-opts, -f, and -l require a filename argument.
qemu-img: --image-opts, -f, and -l require a filename argument.
qemu-img: --image-opts, -f, and -l require a filename argument.
qemu-img: Invalid option list: ,
qemu-img: Invalid parameter 'snapshot.foo'
qemu-img: Failed in parsing snapshot param 'snapshot.foo'