From: Stefan Hajnoczi <stefanha@gmail.com>
To: liguang <lig.fnst@cn.fujitsu.com>
Cc: qemu-trivial <qemu-trivial@nongnu.org>,
Kevin Wolf <kwolf@redhat.com>, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v3] correct error message qemu-img reported
Date: Fri, 2 Nov 2012 08:16:14 +0100 [thread overview]
Message-ID: <CAJSP0QXiLvzW5wUDCwVfnR6UXMv52Nb23314WnCC8-sv4vU_1g@mail.gmail.com> (raw)
In-Reply-To: <1351833082-26633-1-git-send-email-lig.fnst@cn.fujitsu.com>
On Fri, Nov 2, 2012 at 6:11 AM, liguang <lig.fnst@cn.fujitsu.com> wrote:
> diff --git a/qemu-img.c b/qemu-img.c
> index b41e670..d4ea800 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -337,10 +337,15 @@ static int img_create(int argc, char **argv)
>
> /* Get image size, if specified */
> if (optind < argc) {
> - int64_t sval;
> + int64_t sval = 0;
sval is assigned below so there is no need for this change.
> char *end;
> sval = strtosz_suffix(argv[optind++], &end, STRTOSZ_DEFSUFFIX_B);
> - if (sval < 0 || *end) {
> + if (sval < 0) {
> + error_report("image size is too large!");
I suggest being specific about the upper limit so the user knows which
values are valid:
"Image size must be less than 8 exabytes!"
Stefan
next prev parent reply other threads:[~2012-11-02 7:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-02 5:11 [Qemu-devel] [PATCH v3] correct error message qemu-img reported liguang
2012-11-02 7:16 ` Stefan Hajnoczi [this message]
2012-11-05 7:40 ` li guang
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=CAJSP0QXiLvzW5wUDCwVfnR6UXMv52Nb23314WnCC8-sv4vU_1g@mail.gmail.com \
--to=stefanha@gmail.com \
--cc=kwolf@redhat.com \
--cc=lig.fnst@cn.fujitsu.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@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).