[libvirt] [PATCH 1/5] Introduce a more convenient virCgroupNewDetectMachine

Eric Blake eblake at redhat.com
Thu Jul 25 18:54:14 UTC 2013


On 07/25/2013 12:11 PM, Daniel P. Berrange wrote:

>>>  
>>> +/*
>>> + * Returns 0 on success, -1 on fatal error, -2 on no valid cgroup
>>> + */
>>> +int virCgroupNewDetectMachine(const char *name,

>>> +
>>> +    if (!virCgroupIsValidMachineGroup(*group, name, drivername)) {
>>> +        virCgroupFree(group);
>>> +        return 0;
>>
>> Huh? This says you are returning success.  Also, none of the lxc or qemu
>> callers checked for a -2 return; do you really need the differentiated
>> return type?
> 
> Opps the comment is wrong. I originally had it returning -2, but I
> removed that and just useed '0' and let the caller check if 'group != NULL'
> instead.

Ah, then ACK with a fixed doc comment that describes the real convention.

-- 
Eric Blake   eblake 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: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130725/729d01be/attachment-0001.sig>


More information about the libvir-list mailing list