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

Re: [libvirt] [PATCH 1/5] vcpupin: introduce the new libvirt API (virDomainGetVcpupinInfo)



On 06/24/2011 08:53 AM, Daniel Veillard wrote:
>>  
>> +int                     virDomainGetVcpupinInfo (virDomainPtr domain,
>> +                                                 int maxinfo,
>> +                                                 unsigned char *cpumaps,
>> +                                                 int maplen,
>> +                                                 unsigned int flags);
>> +
> 
>  API looks fine to me

I'm not quite sure, yet.

> 
> [...]
>> --- libvirt.orig/src/libvirt.c
>> +++ libvirt/src/libvirt.c
>> @@ -7087,6 +7087,75 @@ error:
>>  }
>>  
>>  /**
>> + * virDomainGetVcpupinInfo:
>> + * @domain: pointer to domain object, or NULL for Domain0
>> + * @maxinfo: the number of cpumap
>> + * @cpumaps: pointer to a bit map of real CPUs for all vcpus of this
>> + *     domain (in 8-bit bytes) (OUT)
>> + *     It's assumed there is <maxinfo> cpumap in cpumaps array.
>> + *     The memory allocated to cpumaps must be (maxinfo * maplen) bytes
>> + *     (ie: calloc(maxinfo, maplen)).
>> + *     One cpumap inside cpumaps has the format described in
>> + *     virDomainPinVcpu() API.
>> + *     Must not be NULL.
>> + * @maplen: the number of bytes in one cpumap, from 1 up to size of CPU map.
>> + *     Must be positive.
>> + * @flags: an OR'ed set of virDomainModificationImpact
>> + *     Must not be specified VIR_DOMAIN_AFFECT_LIVE and
>> + *     VIR_DOMAIN_AFFECT_CONFIG concurrently!
>> + *
>> + * Query the CPU affinity setting of all virtual CPUs of domain, store it
>> + * in cpumaps.
>> + *
>> + * Returns the number of virtual CPUs in case of success,
>> + * -1 in case of failure.
>> + */
>> +int
>> +virDomainGetVcpupinInfo (virDomainPtr domain, int maxinfo,
>> +                         unsigned char *cpumaps, int maplen, unsigned int flags)


What is maxinfo for?  The counterpart is:

virDomainGetVcpus(virDomainPtr domain, virVcpuInfoPtr info, int maxinfo,
                  unsigned char *cpumaps, int maplen)

where maxinfo relates to how large the 'info' array is.  But
virDomainGetVcpupinInfo has no 'info' array.

> 
>   Okay ACK on the API principle from me,

I'm also reviewing the rest of this series.

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

Attachment: signature.asc
Description: OpenPGP digital signature


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