diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2020-02-21 11:25:21 +0000 |
---|---|---|
committer | Max Reitz <mreitz@redhat.com> | 2020-03-11 12:42:29 +0100 |
commit | c3673dcf08c7baf900bf572f6d96d8a7bd565c9d (patch) | |
tree | 363dfab4ae75ba2cee828447efa5109f3556da27 /qemu-img.c | |
parent | a9da6e49d8281e65d172ed843807a613651d4ef3 (diff) |
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>
Diffstat (limited to 'qemu-img.c')
-rw-r--r-- | qemu-img.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/qemu-img.c b/qemu-img.c index 804630a368..4bc40df6d2 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -4932,10 +4932,8 @@ static int img_measure(int argc, char **argv) filename = argv[optind]; } - if (!filename && - (object_opts || image_opts || fmt || snapshot_name || sn_opts)) { - error_report("--object, --image-opts, -f, and -l " - "require a filename argument."); + if (!filename && (image_opts || fmt || snapshot_name || sn_opts)) { + error_report("--image-opts, -f, and -l require a filename argument."); goto out; } if (filename && img_size != UINT64_MAX) { |