All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: mreitz@redhat.com, berto@igalia.com,
	Markus Armbruster <armbru@redhat.com>,
	qemu-block@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v4 1/2] blockdev: Error out on negative throttling option values
Date: Mon, 18 Jan 2016 09:09:22 +0800	[thread overview]
Message-ID: <20160118010921.GA22366@ad.usersys.redhat.com> (raw)
In-Reply-To: <20160115142826.GB3941@noname.redhat.com>

On Fri, 01/15 15:28, Kevin Wolf wrote:
> Am 15.01.2016 um 03:09 hat Fam Zheng geschrieben:
> > The implicit casting from unsigned int to double changes negative values
> > into large positive numbers and accepts them.  We should instead print
> > an error.
> > 
> > Check the number range so this case is caught and reported.
> > 
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> > Reviewed-by: Max Reitz <mreitz@redhat.com>
> > ---
> >  blockdev.c              |  3 ++-
> >  include/qemu/throttle.h |  2 ++
> >  util/throttle.c         | 16 ++++++----------
> >  3 files changed, 10 insertions(+), 11 deletions(-)
> > 
> > diff --git a/blockdev.c b/blockdev.c
> > index 2df0c6d..b925e5d 100644
> > --- a/blockdev.c
> > +++ b/blockdev.c
> > @@ -348,7 +348,8 @@ static bool check_throttle_config(ThrottleConfig *cfg, Error **errp)
> >      }
> >  
> >      if (!throttle_is_valid(cfg)) {
> > -        error_setg(errp, "bps/iops/maxs values must be 0 or greater");
> > +        error_setg(errp, "bps/iops/max values must be within [0, %" PRId64
> > +                         ")", (int64_t)THROTTLE_VALUE_MAX);
> 
> I think that should be "]". If you agree, I'll fix it up while applying.

Yes, that's right. Thanks.

Fam

> 
> >          return false;
> >      }
> 
> Kevin
> 

  reply	other threads:[~2016-01-18  1:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-15  2:09 [Qemu-devel] [PATCH v4 0/2] block: Reject negative values for throttling options Fam Zheng
2016-01-15  2:09 ` [Qemu-devel] [PATCH v4 1/2] blockdev: Error out on negative throttling option values Fam Zheng
2016-01-15 14:26   ` Markus Armbruster
2016-01-15 14:28   ` Kevin Wolf
2016-01-18  1:09     ` Fam Zheng [this message]
2016-01-19 15:07       ` Alberto Garcia
2016-01-15  2:09 ` [Qemu-devel] [PATCH v4 2/2] iotests: Test that negative and large throttle values are rejected Fam Zheng
2016-01-19 15:12   ` Alberto Garcia
2016-01-19  9:50 ` [Qemu-devel] [PATCH v4 0/2] block: Reject negative values for throttling options Markus Armbruster
2016-01-20  2:55   ` Fam Zheng

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=20160118010921.GA22366@ad.usersys.redhat.com \
    --to=famz@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berto@igalia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.