qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Manos Pitsidianakis <el13635@mail.ntua.gr>,
	Stefan Hajnoczi <stefanha@gmail.com>,
	qemu-devel <qemu-devel@nongnu.org>, Kevin Wolf <kwolf@redhat.com>,
	Alberto Garcia <berto@igalia.com>,
	qemu-block <qemu-block@nongnu.org>
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH 4/7] block: convert ThrottleGroup to object with QOM
Date: Wed, 26 Jul 2017 12:40:25 +0100	[thread overview]
Message-ID: <20170726114025.GH18489@stefanha-x1.localdomain> (raw)
In-Reply-To: <20170725162145.algud34mtktskw2c@postretch>

[-- Attachment #1: Type: text/plain, Size: 3311 bytes --]

On Tue, Jul 25, 2017 at 07:21:45PM +0300, Manos Pitsidianakis wrote:
> On Tue, Jul 25, 2017 at 05:09:41PM +0100, Stefan Hajnoczi wrote:
> > On Tue, Jul 25, 2017 at 01:29:08PM +0300, Manos Pitsidianakis wrote:
> > > On Mon, Jul 24, 2017 at 04:12:47PM +0100, Stefan Hajnoczi wrote:
> > > > On Fri, Jul 14, 2017 at 12:45:18PM +0300, Manos Pitsidianakis wrote:
> > > > > ThrottleGroup is converted to an object. This will allow the future
> > > > > throttle block filter drive easy creation and configuration of throttle
> > > > > groups in QMP and cli.
> > > > >
> > > > > A new QAPI struct, ThrottleLimits, is introduced to provide a shared
> > > > > struct for all throttle configuration needs in QMP.
> > > > >
> > > > > ThrottleGroups can be created via CLI as
> > > > >     -object throttling-group,id=foo,x-iops-total=100,x-..
> > > >
> > > > Please make the QOM name and struct name consistent.  Either
> > > > ThrottleGroup/throttle-group or ThrottlingGroup/throttling-group but not
> > > > ThrottleGroup/throttling-group.
> > > 
> > > I did this on purpose because current throttling has ThrottleGroup
> > > internally and throttling.group in the command line. Should we keep this
> > > only in legacy and make it throttle-group everywhere?
> > 
> > I don't see a compatibility issue because -drive throttling.group= is a
> > -drive property while THROTTLE_GROUP ("throttling-group") is a QOM class
> > name.  They are unrelated and the QOM convention is for the
> > typedef/struct name (ThrottleGroup) to be consistent with the QOM class
> > name.
> > 
> > Therefore it should be safe to use "throttle-group" as the QOM class
> > name instead of "throttling-group".
> 
> I meant for consistency not compatibility. Otherwise it probably would be
> better to keep throttle-group/ThrottleGroup in the new interfaces.

You could call it ThrottlingGroup ("throttling-group") for consistency.

> > 
> > > > > +    visit_type_int64(v, name, &value, &local_err);
> > > > > +    if (local_err) {
> > > > > +        goto fail;
> > > > > +    }
> > > > > +    if (value < 0) {
> > > > > +        error_setg(&local_err, "Property value must be in range "
> > > > > +                               "[0, %"PRId64"]", INT64_MAX);
> > > >
> > > > Please print the maximum value relevant to the actual field type instead
> > > > of INT64_MAX.
> > > 
> > > This checks the limits of the int64 field you give to QOM. I think you mean
> > > in the value assignment to each field that follows? In any case, since
> > > unsigned is the only smaller field we could convert it to uint64_t/uint32_t
> > > internally.
> > 
> > I'm saying that UNSIGNED fields are silently truncated if the value is
> > larger than UINT_MAX, and also that the error message is misleading
> > since UNSIGNED fields cannot take values in the whole range we print.
> 
> Yes, wouldn't it be better to convert the unsigned field burst_length to
> uint64_t and take care of the overflow case? The field describes seconds,
> but there's no reason to keep it that small.

A burst_length of UINT_MAX seconds is over 136 years.  I guess unsigned
int was chosen because larger values will never be used :).

That said, making burst_length uint64_t is fine from a compatibility
point of view.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

  reply	other threads:[~2017-07-26 11:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-14  9:45 [Qemu-devel] [PATCH 0/7] add throttle block driver filter Manos Pitsidianakis
2017-07-14  9:45 ` [Qemu-devel] [PATCH 1/7] block: move ThrottleGroup membership to ThrottleGroupMember Manos Pitsidianakis
2017-07-24 14:36   ` Stefan Hajnoczi
2017-07-14  9:45 ` [Qemu-devel] [PATCH 2/7] block: add aio_context field in ThrottleGroupMember Manos Pitsidianakis
2017-07-24 14:38   ` Stefan Hajnoczi
2017-07-14  9:45 ` [Qemu-devel] [PATCH 3/7] block: tidy ThrottleGroupMember initializations Manos Pitsidianakis
2017-07-24 14:39   ` Stefan Hajnoczi
2017-07-14  9:45 ` [Qemu-devel] [PATCH 4/7] block: convert ThrottleGroup to object with QOM Manos Pitsidianakis
2017-07-24 15:12   ` Stefan Hajnoczi
2017-07-25 10:29     ` Manos Pitsidianakis
2017-07-25 16:09       ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-07-25 16:21         ` Manos Pitsidianakis
2017-07-26 11:40           ` Stefan Hajnoczi [this message]
2017-07-14  9:45 ` [Qemu-devel] [PATCH 5/7] block: add throttle block filter driver Manos Pitsidianakis
2017-07-18  9:21   ` [Qemu-devel] [Qemu-block] " Manos Pitsidianakis
2017-07-14  9:45 ` [Qemu-devel] [PATCH 6/7] block: add BlockDevOptionsThrottle to QAPI Manos Pitsidianakis
2017-07-14  9:45 ` [Qemu-devel] [PATCH 7/7] block: add throttle block filter driver interface tests Manos Pitsidianakis

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=20170726114025.GH18489@stefanha-x1.localdomain \
    --to=stefanha@redhat.com \
    --cc=berto@igalia.com \
    --cc=el13635@mail.ntua.gr \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@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).