[libvirt] [PATCHv2] python: Fix emulatorpin API bindings
Peter Krempa
pkrempa at redhat.com
Thu Mar 21 11:34:35 UTC 2013
On 03/20/13 21:12, Eric Blake wrote:
> On 03/20/2013 08:48 AM, Peter Krempa wrote:
>> The addition of emulator pinning APIs didn't think of doing the right
>> job with python APIs for them. The default generator produced unusable
>> code for this.
>>
>> This patch switches to proper code as in the case of domain Vcpu pining.
>> This change can be classified as a python API-breaker but in the state
>> the code was before I doubt anyone was able to use it successfully.
>> ---
>> python/generator.py | 2 +
>> python/libvirt-override-api.xml | 18 +++++-
>> python/libvirt-override.c | 118 ++++++++++++++++++++++++++++++++++++++++
>> 3 files changed, 136 insertions(+), 2 deletions(-)
>
>
>
>> +static PyObject *
>> +libvirt_virDomainGetEmulatorPinInfo(PyObject *self ATTRIBUTE_UNUSED,
>> + PyObject *args)
>> +{
>
>> +
>> + for (pcpu = 0; pcpu < cpunum; pcpu++)
>> + PyTuple_SET_ITEM(pycpumap, pcpu,
>> + PyBool_FromLong(VIR_CPU_USABLE(cpumap, cpumaplen,
>> + 0, pcpu)));
>
> The counterpart of libvirt_virDomainGetVpcpuPinInfo() used
> PyTuple_SetItem instead of PyTuple_SET_ITEM; any reason?
I wanted to make it explicit that we don't care about the return value.
>
> At any rate, this looks sane modulo the whitespace tweak, so:
>
> ACK.
>
I fixed the whitespace and pushed.
Thanks
Peter
More information about the libvir-list
mailing list