From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
qemu-block@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: [PATCH v2 3/4] qemu-img: allow qemu-img measure --object without a filename
Date: Thu, 9 Jan 2020 11:10:11 +0000 [thread overview]
Message-ID: <20200109111012.559052-4-stefanha@redhat.com> (raw)
In-Reply-To: <20200109111012.559052-1-stefanha@redhat.com>
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>
---
qemu-img.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index 6233b8ca56..4f3e58f13b 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -4903,10 +4903,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) {
--
2.24.1
next prev parent reply other threads:[~2020-01-09 11:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-09 11:10 [PATCH v2 0/4] luks: add qemu-img measure support Stefan Hajnoczi
2020-01-09 11:10 ` [PATCH v2 1/4] luks: extract block_crypto_calculate_payload_offset() Stefan Hajnoczi
2020-01-14 15:25 ` Max Reitz
2020-01-15 13:40 ` Stefan Hajnoczi
2020-01-15 14:35 ` Max Reitz
2020-01-09 11:10 ` [PATCH v2 2/4] luks: implement .bdrv_measure() Stefan Hajnoczi
2020-01-14 15:43 ` Max Reitz
2020-01-15 13:41 ` Stefan Hajnoczi
2020-01-09 11:10 ` Stefan Hajnoczi [this message]
2020-01-14 15:44 ` [PATCH v2 3/4] qemu-img: allow qemu-img measure --object without a filename Max Reitz
2020-01-09 11:10 ` [PATCH v2 4/4] iotests: add 282 luks qemu-img measure test Stefan Hajnoczi
2020-01-14 15:48 ` Max Reitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200109111012.559052-4-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).