[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v9 4/6] block: convert ThrottleGroup to object w
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-block] [PATCH v9 4/6] block: convert ThrottleGroup to object with QOM |
Date: |
Tue, 5 Sep 2017 14:49:52 +0100 |
User-agent: |
Mutt/1.8.3 (2017-05-23) |
On Fri, Aug 25, 2017 at 04:20:26PM +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 throttle-group,id=foo,x-iops-total=100,x-..
> where x-* are individual limit properties. Since we can't add non-scalar
> properties in -object this interface must be used instead. However,
> setting these properties must be disabled after initialization because
> certain combinations of limits are forbidden and thus configuration
> changes should be done in one transaction. The individual properties
> will go away when support for non-scalar values in CLI is implemented
> and thus are marked as experimental.
>
> ThrottleGroup also has a `limits` property that uses the ThrottleLimits
> struct. It can be used to create ThrottleGroups or set the
> configuration in existing groups as follows:
>
> { "execute": "object-add",
> "arguments": {
> "qom-type": "throttle-group",
> "id": "foo",
> "props" : {
> "limits": {
> "iops-total": 100
> }
> }
> }
> }
> { "execute" : "qom-set",
> "arguments" : {
> "path" : "foo",
> "property" : "limits",
> "value" : {
> "iops-total" : 99
> }
> }
> }
>
> This also means a group's configuration can be fetched with qom-get.
>
> Signed-off-by: Manos Pitsidianakis <address@hidden>
> ---
> qapi/block-core.json | 48 +++++
> include/block/throttle-groups.h | 3 +
> include/qemu/throttle-options.h | 59 ++++--
> include/qemu/throttle.h | 3 +
> block/throttle-groups.c | 422
> ++++++++++++++++++++++++++++++++++++----
> tests/test-throttle.c | 1 +
> util/throttle.c | 151 ++++++++++++++
> 7 files changed, 627 insertions(+), 60 deletions(-)
Reviewed-by: Stefan Hajnoczi <address@hidden>
- Re: [Qemu-block] [PATCH v9 4/6] block: convert ThrottleGroup to object with QOM,
Stefan Hajnoczi <=