From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Eyal Moscovici <eyal.moscovici@oracle.com>,
"open list:Block layer core" <qemu-block@nongnu.org>,
Max Reitz <mreitz@redhat.com>
Subject: Re: [PULL 2/6] qemu_img: add cvtnum_full to print error reports
Date: Wed, 20 May 2020 16:39:32 -0500 [thread overview]
Message-ID: <3a03c86e-94af-317a-09d1-30ae6abc640d@redhat.com> (raw)
In-Reply-To: <20200518163218.649412-3-eblake@redhat.com>
On 5/18/20 11:32 AM, Eric Blake wrote:
> From: Eyal Moscovici <eyal.moscovici@oracle.com>
>
> All calls to cvtnum check the return value and print the same error
> message more or less. And so error reporting moved to cvtnum_full to
> reduce code duplication and provide a single error
> message. Additionally, cvtnum now wraps cvtnum_full with the existing
> default range of 0 to MAX_INT64.
>
> Acked-by: Mark Kanda <mark.kanda@oracle.com>
> Signed-off-by: Eyal Moscovici <eyal.moscovici@oracle.com>
> Message-Id: <20200513133629.18508-2-eyal.moscovici@oracle.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>
> [eblake: fix printf formatting, avoid trailing space, change error wording,
> reformat commit message]
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> @@ -572,16 +584,8 @@ static int img_create(int argc, char **argv)
> if (optind < argc) {
> int64_t sval;
>
> - sval = cvtnum(argv[optind++]);
> + sval = cvtnum("image size", argv[optind++]);
> if (sval < 0) {
> - if (sval == -ERANGE) {
> - error_report("Image size must be less than 8 EiB!");
This change broke iotest 178:
--- /home/eblake/qemu/tests/qemu-iotests/178.out.qcow2 2020-05-20
16:33:20.065710365 -0500
+++ /home/eblake/qemu/build/tests/qemu-iotests/178.out.bad 2020-05-20
16:35:28.924512423 -0500
@@ -13,7 +13,7 @@
qemu-img: Invalid parameter 'snapshot.foo'
qemu-img: Failed in parsing snapshot param 'snapshot.foo'
qemu-img: --output must be used with human or json as argument.
-qemu-img: Image size must be less than 8 EiB!
+qemu-img: Invalid image size specified. Must be between 0 and
9223372036854775807.
qemu-img: Unknown file format 'foo'
== Size calculation for a new file (human) ==
I'll post a followup patch shortly.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2020-05-20 21:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-18 16:32 [PULL 0/6] NBD patches for 2020-05-18 Eric Blake
2020-05-18 16:32 ` [PULL 1/6] qemu-nbd: Close inherited stderr Eric Blake
2020-05-18 16:32 ` [PULL 2/6] qemu_img: add cvtnum_full to print error reports Eric Blake
2020-05-20 21:39 ` Eric Blake [this message]
2020-05-18 16:32 ` [PULL 3/6] qemu-img: validate image length in img_map Eric Blake
2020-05-18 16:32 ` [PULL 4/6] qemu-img: refactor dump_map_entry JSON format output Eric Blake
2020-05-18 16:32 ` [PULL 5/6] qemu-img: Add --start-offset and --max-length to map Eric Blake
2020-05-18 16:32 ` [PULL 6/6] iotests: Enhance 223 to cover qemu-img map improvements Eric Blake
2020-05-18 20:51 ` [PULL 0/6] NBD patches for 2020-05-18 Eric Blake
2020-05-19 10:58 ` Peter Maydell
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=3a03c86e-94af-317a-09d1-30ae6abc640d@redhat.com \
--to=eblake@redhat.com \
--cc=eyal.moscovici@oracle.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).