qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v4] correct error message qemu-img reported
@ 2012-11-05  7:41 liguang
  2012-11-05 10:27 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: liguang @ 2012-11-05  7:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, liguang

qemu-img will complain when qcow or qcow2
size overflow for 64 bits, report the right
message in this condition.

Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
---
 qemu-img.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/qemu-img.c b/qemu-img.c
index b41e670..d9434ad 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -340,7 +340,12 @@ static int img_create(int argc, char **argv)
         int64_t sval;
         char *end;
         sval = strtosz_suffix(argv[optind++], &end, STRTOSZ_DEFSUFFIX_B);
-        if (sval < 0 || *end) {
+        if (sval < 0) {
+            error_report("Image size must be less than 8 exabytes!");
+            ret = -1;
+            goto out;
+        }
+        if (*end) {
             error_report("Invalid image size specified! You may use k, M, G or "
                   "T suffixes for ");
             error_report("kilobytes, megabytes, gigabytes and terabytes.");
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH v4] correct error message qemu-img reported
  2012-11-05  7:41 [Qemu-devel] [PATCH v4] correct error message qemu-img reported liguang
@ 2012-11-05 10:27 ` Stefan Hajnoczi
  2012-12-06  8:47   ` li guang
  2012-12-06 10:04 ` [Qemu-devel] " Kevin Wolf
  2013-01-03  0:19 ` Anthony Liguori
  2 siblings, 1 reply; 8+ messages in thread
From: Stefan Hajnoczi @ 2012-11-05 10:27 UTC (permalink / raw)
  To: liguang; +Cc: qemu-trivial, Kevin Wolf, qemu-devel

On Mon, Nov 5, 2012 at 8:41 AM, liguang <lig.fnst@cn.fujitsu.com> wrote:
> qemu-img will complain when qcow or qcow2
> size overflow for 64 bits, report the right
> message in this condition.
>
> Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
> ---
>  qemu-img.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH v4] correct error message qemu-img reported
  2012-11-05 10:27 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
@ 2012-12-06  8:47   ` li guang
  0 siblings, 0 replies; 8+ messages in thread
From: li guang @ 2012-12-06  8:47 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-trivial, Kevin Wolf, qemu-devel

Hi, Stefan

seems this tiny patch was ignored.

在 2012-11-05一的 11:27 +0100,Stefan Hajnoczi写道:
> On Mon, Nov 5, 2012 at 8:41 AM, liguang <lig.fnst@cn.fujitsu.com> wrote:
> > qemu-img will complain when qcow or qcow2
> > size overflow for 64 bits, report the right
> > message in this condition.
> >
> > Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
> > ---
> >  qemu-img.c |    7 ++++++-
> >  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

-- 
regards!
li guang

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH v4] correct error message qemu-img reported
  2012-11-05  7:41 [Qemu-devel] [PATCH v4] correct error message qemu-img reported liguang
  2012-11-05 10:27 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
@ 2012-12-06 10:04 ` Kevin Wolf
  2012-12-07  3:56   ` li guang
  2013-01-03  0:19 ` Anthony Liguori
  2 siblings, 1 reply; 8+ messages in thread
From: Kevin Wolf @ 2012-12-06 10:04 UTC (permalink / raw)
  To: liguang; +Cc: qemu-trivial, Stefan Hajnoczi, qemu-devel

Am 05.11.2012 08:41, schrieb liguang:
> qemu-img will complain when qcow or qcow2
> size overflow for 64 bits, report the right
> message in this condition.
> 
> Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
> ---
>  qemu-img.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/qemu-img.c b/qemu-img.c
> index b41e670..d9434ad 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -340,7 +340,12 @@ static int img_create(int argc, char **argv)
>          int64_t sval;
>          char *end;
>          sval = strtosz_suffix(argv[optind++], &end, STRTOSZ_DEFSUFFIX_B);
> -        if (sval < 0 || *end) {
> +        if (sval < 0) {
> +            error_report("Image size must be less than 8 exabytes!");
> +            ret = -1;
> +            goto out;
> +        }

This is wrong, overflows are not the only way how strtosz_suffix() can fail.

Before this patch:

$ ./qemu-img create /tmp/foo bar
qemu-img: Invalid image size specified! You may use k, M, G or T
suffixes for
qemu-img: kilobytes, megabytes, gigabytes and terabytes

With the patch applied:

$ ./qemu-img create /tmp/foo bar
qemu-img: Image size must be less than 8 exabytes!

Kevin


> +        if (*end) {
>              error_report("Invalid image size specified! You may use k, M, G or "
>                    "T suffixes for ");
>              error_report("kilobytes, megabytes, gigabytes and terabytes.");
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH v4] correct error message qemu-img reported
  2012-12-06 10:04 ` [Qemu-devel] " Kevin Wolf
@ 2012-12-07  3:56   ` li guang
  0 siblings, 0 replies; 8+ messages in thread
From: li guang @ 2012-12-07  3:56 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-trivial, Stefan Hajnoczi, qemu-devel

在 2012-12-06四的 11:04 +0100,Kevin Wolf写道:
> Am 05.11.2012 08:41, schrieb liguang:
> > qemu-img will complain when qcow or qcow2
> > size overflow for 64 bits, report the right
> > message in this condition.
> > 
> > Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
> > ---
> >  qemu-img.c |    7 ++++++-
> >  1 files changed, 6 insertions(+), 1 deletions(-)
> > 
> > diff --git a/qemu-img.c b/qemu-img.c
> > index b41e670..d9434ad 100644
> > --- a/qemu-img.c
> > +++ b/qemu-img.c
> > @@ -340,7 +340,12 @@ static int img_create(int argc, char **argv)
> >          int64_t sval;
> >          char *end;
> >          sval = strtosz_suffix(argv[optind++], &end, STRTOSZ_DEFSUFFIX_B);
> > -        if (sval < 0 || *end) {
> > +        if (sval < 0) {
> > +            error_report("Image size must be less than 8 exabytes!");
> > +            ret = -1;
> > +            goto out;
> > +        }
> 
> This is wrong, overflows are not the only way how strtosz_suffix() can fail.
> 
> Before this patch:
> 
> $ ./qemu-img create /tmp/foo bar
> qemu-img: Invalid image size specified! You may use k, M, G or T
> suffixes for
> qemu-img: kilobytes, megabytes, gigabytes and terabytes
> 
> With the patch applied:
> 
> $ ./qemu-img create /tmp/foo bar
> qemu-img: Image size must be less than 8 exabytes!
> 

Oh, my fault, I'll fix.
Thanks!

> Kevin
> 
> 
> > +        if (*end) {
> >              error_report("Invalid image size specified! You may use k, M, G or "
> >                    "T suffixes for ");
> >              error_report("kilobytes, megabytes, gigabytes and terabytes.");
> > 
> 
> 
> 

-- 
regards!
li guang

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH v4] correct error message qemu-img reported
  2012-11-05  7:41 [Qemu-devel] [PATCH v4] correct error message qemu-img reported liguang
  2012-11-05 10:27 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
  2012-12-06 10:04 ` [Qemu-devel] " Kevin Wolf
@ 2013-01-03  0:19 ` Anthony Liguori
  2013-01-03  1:08   ` Peter Maydell
  2 siblings, 1 reply; 8+ messages in thread
From: Anthony Liguori @ 2013-01-03  0:19 UTC (permalink / raw)
  To: liguang, qemu-devel; +Cc: qemu-trivial

Hi,

This is an automated message generated from the QEMU Patches.
Thank you for submitting this patch.  This patch no longer applies to qemu.git.

This may have occurred due to:
 
  1) Changes in mainline requiring your patch to be rebased and re-tested.

  2) Sending the mail using a tool other than git-send-email.  Please use
     git-send-email to send patches to QEMU.

  3) Basing this patch off of a branch that isn't tracking the QEMU
     master branch.  If that was done purposefully, please include the name
     of the tree in the subject line in the future to prevent this message.

     For instance: "[PATCH block-next 1/10] qcow3: add fancy new feature"

  4) You no longer wish for this patch to be applied to QEMU.  No additional
     action is required on your part.

Nacked-by: QEMU Patches <aliguori@us.ibm.com>

Below is the output from git-am:

    Applying: correct error message qemu-img reported
    Using index info to reconstruct a base tree...
    M	qemu-img.c
    Falling back to patching base and 3-way merge...
    Auto-merging qemu-img.c
    CONFLICT (content): Merge conflict in qemu-img.c
    Failed to merge in the changes.
    Patch failed at 0001 correct error message qemu-img reported
    The copy of the patch that failed is found in:
       /home/aliguori/patches/qemu.git/.git/rebase-apply/patch
    When you have resolved this problem run "git am --resolved".
    If you would prefer to skip this patch, instead run "git am --skip".
    To restore the original branch and stop patching run "git am --abort".

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH v4] correct error message qemu-img reported
  2013-01-03  0:19 ` Anthony Liguori
@ 2013-01-03  1:08   ` Peter Maydell
  2013-01-03  2:15     ` Anthony Liguori
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Maydell @ 2013-01-03  1:08 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: qemu-trivial, qemu-devel, liguang

On 3 January 2013 00:19, Anthony Liguori <aliguori@us.ibm.com> wrote:
> This is an automated message generated from the QEMU Patches.
> Thank you for submitting this patch.  This patch no longer applies to qemu.git.

> Nacked-by: QEMU Patches <aliguori@us.ibm.com>

Are we going to get these emails on every old patch that was
superseded by a later fixed version 2?

-- PMM

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH v4] correct error message qemu-img reported
  2013-01-03  1:08   ` Peter Maydell
@ 2013-01-03  2:15     ` Anthony Liguori
  0 siblings, 0 replies; 8+ messages in thread
From: Anthony Liguori @ 2013-01-03  2:15 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-trivial, qemu-devel, liguang

Peter Maydell <peter.maydell@linaro.org> writes:

> On 3 January 2013 00:19, Anthony Liguori <aliguori@us.ibm.com> wrote:
>> This is an automated message generated from the QEMU Patches.
>> Thank you for submitting this patch.  This patch no longer applies to qemu.git.
>
>> Nacked-by: QEMU Patches <aliguori@us.ibm.com>
>
> Are we going to get these emails on every old patch that was
> superseded by a later fixed version 2?

Nope.

Patches detects obsoleted patches and ignores them.  It also detects
patches that have been committed in submaintainer trees but have not yet
made there way into qemu.git.

Regards,

Anthony Liguori

>
> -- PMM

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-01-03  2:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-05  7:41 [Qemu-devel] [PATCH v4] correct error message qemu-img reported liguang
2012-11-05 10:27 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
2012-12-06  8:47   ` li guang
2012-12-06 10:04 ` [Qemu-devel] " Kevin Wolf
2012-12-07  3:56   ` li guang
2013-01-03  0:19 ` Anthony Liguori
2013-01-03  1:08   ` Peter Maydell
2013-01-03  2:15     ` Anthony Liguori

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).