[libvirt] [perl-Sys-Virt][PATCH] Virt.xs: fix flag issue on set_scheduler_parameters

Eric Blake eblake at redhat.com
Fri Aug 31 18:45:55 UTC 2012


On 08/29/2012 02:56 AM, Alex Jia wrote:
> On 08/29/2012 02:12 PM, Guannan Ren wrote:
>> On 08/28/2012 11:38 AM, Alex Jia wrote:
>>> From: Alex Jia <Alex Jia ajia at redhat.com>
>>>
>>> The default flags are inconsistent on both qemuSetSchedulerParameters()
>>> and qemuGetSchedulerParameters() in libvirt, the
>>> qemuGetSchedulerParameters()
>>> always passes 'VIR_DOMAIN_AFFECT_CURRENT' flag to the
>>> qemuGetSchedulerParametersFlags(),
>>> it should be a expected behavior, but the
>>> qemuSetSchedulerParameters() always passes
>>> 'VIR_DOMAIN_AFFECT_LIVE' flag to the
>>> qemuSetSchedulerParametersFlags(), if users use
>>> default flag=0 or explicitly give a 'VIR_DOMAIN_AFFECT_CURRENT' flag
>>> to the
>>> set_scheduler_parameters() in perl-Sys-Virt, because the flag value
>>> is 0, the result is
>>> the virDomainSetSchedulerParameters() is called incorrectly.
>>

>>> +++ b/Virt.xs
>>> @@ -2833,7 +2833,7 @@ set_scheduler_parameters(dom, newparams, flags=0)
>>
>>            How about setting flags = -1 as default value.
>>            set_scheduler_parameters(dom, newparams, flags=-1)
>>            int flags;
> 
> I don't want to change many codes, so just change condition judgement in
> here, in fact, it's
> enough to call  virDomainSetSchedulerParametersFlags() regardless of
> what flag is like 'virsh schedinfo',
> hence, I trend to remove virDomainSetSchedulerParameters() relevant branch.

That's not quite correct - remember,
virDomainSetSchedulerParametersFlags() is a newer function, and when
talking to older libvirtd, it did not work when the older function
virDomainSetSchedulerParameters() will work.  Thus, if flags is 0, you
should call the older function, for a better chance of working across
more setups.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

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


More information about the libvir-list mailing list