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 <el13...@mail.ntua.gr>
> +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