All of lore.kernel.org
 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>,
	qemu-block <qemu-block@nongnu.org>,
	Alberto Garcia <berto@igalia.com>
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH RFC v3 4/8] block: convert ThrottleGroup to object with QOM
Date: Tue, 27 Jun 2017 13:57:20 +0100	[thread overview]
Message-ID: <20170627125720.GG8555@stefanha-x1.localdomain> (raw)
In-Reply-To: <20170626152409.banswonpr6aj4h55@postretch>

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

On Mon, Jun 26, 2017 at 06:24:09PM +0300, Manos Pitsidianakis wrote:
> On Mon, Jun 26, 2017 at 03:52:34PM +0100, Stefan Hajnoczi wrote:
> > > +static void throttle_group_set(Object *obj, Visitor *v, const char * name,
> > > +        void *opaque, Error **errp)
> > > +
> > > +{
> > > +    ThrottleGroup *tg = THROTTLE_GROUP(obj);
> > > +    ThrottleConfig cfg = tg->ts.cfg;
> > > +    Error *local_err = NULL;
> > > +    ThrottleParamInfo *info = opaque;
> > > +    int64_t value;
> > 
> > What happens if this property is set while QEMU is already running?
> 
> I assume you mean setting a property while a group has active members and
> requests? My best answer would be "don't do that". I couldn't figure a way
> to do this cleanly. Individual limit changes may render a ThrottleConfig
> invalid, so it should not be allowed. ThrottleGroups and throttle nodes
> should be destroyed and recreated to change limits with this version, but in
> the next it will be done through block_set_io_throttle() which is the
> existing way to change limits and check for validity. This was discussed in
> the proposal about the new syntax we had on the list.

Please ask on IRC or the mailing list if you have questions.

If you are aware of a limitation and don't know the answer then
submitting the code without any comment or question is dangerous.
Reviewers may miss the problem :) and broken code gets merged.

UserCreatableClass has a ->complete() callback.  You can use this to
perform final initialization and then "freeze" the properties by setting
a bool flag.  The property accessor functions can do:

  if (tg->init_complete) {
      error_setg(errp, "Property modification is not allowed at run-time");
      return;
  }

Something like this is used by
backends/hostmem.c:host_memory_backend_set_size(), for example.

> > 
> > > +        goto out;
> > > +    }
> > 
> > This doesn't validate inputs properly for non int64_t types.
> > 
> > I'm also worried that the command-line bps=,iops=,... options do not
> > have unsigned or double types.  Input ranges and validation should match
> > the QEMU command-line (I know this is a bit of a pain with QOM since the
> > property types are different from QEMU option types).
> 
> I don't know what should be done about this, to be honest, except for
> manually checking the limits for each datatype in the QOM setters.

I believe all throttling parameter types are int64_t in QemuOpts.  If we
want to be compatible with the command-line parameters then they should
also be int64_t here instead of unsigned int or double.

This approach makes sense from the QMP user perspective.  QMP clients
shouldn't have to deal with different data types depending on which
throttling API they use.  Let's keep it consistent - there's no real
drawback to using int64_t.

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

  reply	other threads:[~2017-06-27 12:57 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-23 12:46 [Qemu-devel] [PATCH RFC v3 0/8] I/O Throtting block filter driver Manos Pitsidianakis
2017-06-23 12:46 ` [Qemu-devel] [PATCH RFC v3 1/8] block: move ThrottleGroup membership to ThrottleGroupMember Manos Pitsidianakis
2017-06-26 13:23   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-06-27 12:08   ` [Qemu-devel] " Alberto Garcia
2017-06-27 12:24     ` Manos Pitsidianakis
2017-06-23 12:46 ` [Qemu-devel] [PATCH RFC v3 2/8] block: Add aio_context field in ThrottleGroupMember Manos Pitsidianakis
2017-06-26 13:36   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-06-26 14:03     ` Manos Pitsidianakis
2017-06-27 12:39   ` [Qemu-devel] " Alberto Garcia
2017-06-28 11:27   ` Kevin Wolf
2017-06-28 12:15     ` Manos Pitsidianakis
2017-06-28 12:44       ` Kevin Wolf
2017-06-23 12:46 ` [Qemu-devel] [PATCH RFC v3 3/8] block: add throttle block filter driver Manos Pitsidianakis
2017-06-26 14:00   ` [Qemu-devel] [Qemu-block] " Manos Pitsidianakis
2017-06-26 14:30   ` Stefan Hajnoczi
2017-06-26 16:01     ` Manos Pitsidianakis
2017-06-27 12:42       ` Stefan Hajnoczi
2017-06-26 16:26     ` Manos Pitsidianakis
2017-06-27 12:45       ` Stefan Hajnoczi
2017-06-27 13:34         ` Manos Pitsidianakis
2017-06-28 12:11           ` Stefan Hajnoczi
2017-06-26 14:34   ` Stefan Hajnoczi
2017-06-28 14:40   ` [Qemu-devel] " Kevin Wolf
2017-06-28 15:22     ` Manos Pitsidianakis
2017-06-28 15:36       ` Kevin Wolf
2017-06-28 15:50         ` Manos Pitsidianakis
2017-06-23 12:46 ` [Qemu-devel] [PATCH RFC v3 4/8] block: convert ThrottleGroup to object with QOM Manos Pitsidianakis
2017-06-26 14:52   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-06-26 15:24     ` Manos Pitsidianakis
2017-06-27 12:57       ` Stefan Hajnoczi [this message]
2017-06-26 16:58     ` Manos Pitsidianakis
2017-06-27 13:02       ` Stefan Hajnoczi
2017-06-27 16:05       ` Alberto Garcia
2017-06-27 16:12         ` Manos Pitsidianakis
2017-06-28 12:07         ` Stefan Hajnoczi
2017-06-23 12:46 ` [Qemu-devel] [PATCH RFC v3 5/8] block: add BlockDevOptionsThrottle to QAPI Manos Pitsidianakis
2017-06-26 14:55   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-06-27 13:12   ` [Qemu-devel] " Eric Blake
2017-06-28 13:35   ` Alberto Garcia
2017-06-28 13:42     ` Manos Pitsidianakis
2017-06-28 15:50   ` Kevin Wolf
2017-06-28 16:02     ` Eric Blake
2017-06-28 16:18       ` Kevin Wolf
2017-06-23 12:46 ` [Qemu-devel] [PATCH RFC v3 6/8] block: add options parameter to bdrv_new_open_driver() Manos Pitsidianakis
2017-06-26 15:11   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-06-28 15:55     ` Kevin Wolf
2017-06-28 13:42   ` [Qemu-devel] " Alberto Garcia
2017-06-28 13:47     ` Manos Pitsidianakis
2017-06-23 12:46 ` [Qemu-devel] [PATCH RFC v3 7/8] block: remove legacy I/O throttling Manos Pitsidianakis
2017-06-26 15:44   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-06-26 22:45     ` Manos Pitsidianakis
2017-06-27 13:08       ` Stefan Hajnoczi
2017-06-23 12:47 ` [Qemu-devel] [PATCH RFC v3 8/8] block: add throttle block filter driver interface tests Manos Pitsidianakis
2017-06-28 11:18   ` Kevin Wolf
2017-06-26 15:46 ` [Qemu-devel] [Qemu-block] [PATCH RFC v3 0/8] I/O Throtting block filter driver Stefan Hajnoczi

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=20170627125720.GG8555@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 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.