[libvirt] [PATCH 3/7] sched: introduce virDomainGetSchedulerParametersFlags

Eric Blake eblake at redhat.com
Wed May 18 14:47:03 UTC 2011


On 05/17/2011 09:18 PM, Hu Tao wrote:
>> +int
>> +virDomainGetSchedulerParametersFlags(virDomainPtr domain,
>> +                                     virSchedParameterPtr params, int *nparams,
>> +                                     unsigned int flags)
>> +{
>> +    virConnectPtr conn;
>> +
>> +    VIR_DOMAIN_DEBUG(domain, "params=%p, nparams=%p, flags=%u",
>> +                     params, nparams, flags);
>> +
>> +    virResetLastError();
>> +
>> +    if (!(flags & (VIR_DOMAIN_SCHEDPARAM_LIVE |
>> +                   VIR_DOMAIN_SCHEDPARAM_CONFIG |
>> +                   VIR_DOMAIN_SCHEDPARAM_CURRENT))) {
>> +        virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
>> +        virDispatchError(NULL);
>> +        return -1;
>> +    }
> 
> Causes problem with:
> 
> virsh schedinfo vm --set cpu_shares=1024 --current
> 
> where vm is an inactive domain.

Yep, the solution is the same as for your SetSchedulerParametersFlags -
I agree with removing the flag check in libvirt.c and instead making the
callbacks do the check.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110518/8bf0f96c/attachment-0001.sig>


More information about the libvir-list mailing list