在 2012-11-02五的 08:16 +0100,Stefan Hajnoczi写道: > On Fri, Nov 2, 2012 at 6:11 AM, liguang <lig.f...@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.f...@cn.fujitsu.com FNST linux kernel team