[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] RFC: APIs for managing resource groups



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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]