[libvirt] RFC: APIs for managing resource groups

Jiri Denemark jdenemar at redhat.com
Tue Feb 26 11:11:18 UTC 2013


On Mon, Feb 25, 2013 at 12:41:06 +0000, Daniel P. Berrange wrote:
...
> Then I think we'll duplicate all the APIs for setting resource tunables
> from virDomainPtr against the new object, so we get
> 
> 
> int virPartitionGetSchedulerParameters(virPartitionPtr partition,
>                                        virTypedParameterPtr params,
>                                        int *nparams,
>                                        unsigned int flags);

My comment is not really specific to resource groups but since you
suggest to copy APIs that return typed parameters, could you make them
autoallocate params array (see virDomainJobGetStats)? That is

    int virPartitionGetSchedulerParameters(virPartitionPtr partition,
                                           virTypedParameterPtr *params,
                                           int *nparams,
                                           unsigned int flags);

Having to call each API twice, first to get the number of parameters it
can return and then to get the actual parameters is a horrible design.

Jirka




More information about the libvir-list mailing list