qemu-block
[Top][All Lists]
Advanced

[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: Kevin Wolf
Subject: Re: [Qemu-block] [PATCH v9 4/6] block: convert ThrottleGroup to object with QOM
Date: Tue, 5 Sep 2017 17:21:07 +0200
User-agent: Mutt/1.8.3 (2017-05-23)

Am 25.08.2017 um 15:20 hat Manos Pitsidianakis geschrieben:
> 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>

> +static bool throttle_group_can_be_deleted(UserCreatable *uc, Error **errp)
> +{
> +    return OBJECT(uc)->ref == 1;
> +}
> +
> +static void throttle_group_obj_class_init(ObjectClass *klass, void 
> *class_data)
> +{
> +    size_t i = 0;
> +    UserCreatableClass *ucc = USER_CREATABLE_CLASS(klass);
> +
> +    ucc->complete = throttle_group_obj_complete;
> +    ucc->can_be_deleted = throttle_group_can_be_deleted;

block/throttle-groups.c: In function 'throttle_group_obj_class_init':
block/throttle-groups.c:880:25: error: assignment from incompatible pointer 
type [-Werror=incompatible-pointer-types]
     ucc->can_be_deleted = throttle_group_can_be_deleted;

This is from a semantic conflict with commit 3beacfb9 ('qom: Remove
unused errp parameter from can_be_deleted()'). If the rest of the series
is okay, I'll just remove the **errp parameter while applying.

Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]