[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 4/7] throttle: Add throttle group support
From: |
Alberto Garcia |
Subject: |
Re: [Qemu-devel] [PATCH 4/7] throttle: Add throttle group support |
Date: |
Fri, 10 Apr 2015 09:58:34 +0200 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Thu, Apr 09, 2015 at 03:22:57PM +0100, Stefan Hajnoczi wrote:
> > @@ -1941,9 +1951,11 @@ void qmp_block_set_io_throttle(const char *device,
> > int64_t bps, int64_t bps_rd,
> > aio_context_acquire(aio_context);
> >
> > if (!bs->io_limits_enabled && throttle_enabled(&cfg)) {
> > - bdrv_io_limits_enable(bs);
> > + bdrv_io_limits_enable(bs, has_group ? group : device);
> > } else if (bs->io_limits_enabled && !throttle_enabled(&cfg)) {
> > bdrv_io_limits_disable(bs);
> > + } else if (bs->io_limits_enabled && throttle_enabled(&cfg)) {
> > + bdrv_io_limits_update_group(bs, has_group ? group : device);
> > }
> >
> > if (bs->io_limits_enabled) {
>
> The semantics are inconsistent:
>
> 1. Create drive0 with throttle group "mygroup".
> 2. Issue block-set-io-throttle device="drive0"
>
> The result is that a new throttle group called "drive0" is created.
> I expected to modify the throttling configuration for drive0 (i.e.
> "mygroup").
That's right. What we can do is choose the group to update using the
following criteria, in order of precedence:
1) The 'group' parameter from block-set-io-throttle.
2) The group the device is already member of.
3) A new group ("drive0" in this example).
Currently we're not doing 2).
> Now let's disable the throttle group:
>
> 3. Issue block-set-io-throttle with 0 values for device="drive0"
>
> The result is that "mygroup" is changed to all 0s.
No, that simply removes the device from the group without touching its
configuration:
> > } else if (bs->io_limits_enabled && !throttle_enabled(&cfg)) {
> > bdrv_io_limits_disable(bs);
The group name passed by the user is actually not used in this case.
Berto