From: li guang <lig.fnst@cn.fujitsu.com>
To: Stefan Hajnoczi <stefanha@gmail.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: Mon, 05 Nov 2012 15:40:07 +0800 [thread overview]
Message-ID: <1352101207.11909.0.camel@liguang.fnst.cn.fujitsu.com> (raw)
In-Reply-To: <CAJSP0QXiLvzW5wUDCwVfnR6UXMv52Nb23314WnCC8-sv4vU_1g@mail.gmail.com>
在 2012-11-02五的 08:16 +0100,Stefan Hajnoczi写道:
> 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
>
OK, will fix.
--
liguang lig.fnst@cn.fujitsu.com
FNST linux kernel team
prev parent reply other threads:[~2012-11-05 7:41 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
2012-11-05 7:40 ` li guang [this message]
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=1352101207.11909.0.camel@liguang.fnst.cn.fujitsu.com \
--to=lig.fnst@cn.fujitsu.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=stefanha@gmail.com \
/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).