Re: [PATCH 3/5] list: Implement listAllInterfaces

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

 



On 09/11/2012 09:05 PM, Osier Yang wrote:
>>> +
>>> +    if (VIR_ALLOC_N(names, count)<  0) {
>>> +        virReportOOMError();
>>> +        return -1;
>>> +    }
>>
>>
>> If you want to check for a race here, you could allocate count+1 items
>> in the array, then do an ncf_list_interfaces telling it the maxcount is
>> "count+1" and check to see that you really only got count items back.
> 
> No want I think, :-)
> 
> Since I will adopt your below suggestion to igore the no found interface
> by "ncf_lookup_by_name", that means we should either ignore the race, or
> raise up error earlier here.
> 
> I think ignoring is better, any objections?

If we want to use the count+1 trick to ensure things didn't grow in the
meantime, then we should do it for ALL the fallbacks when vir*ListAll is
missing, not just the network listing.  I'm okay with not checking for
truncation, as it's simpler, and as it will only affect the fallback
code which we already documented in virsh.pod as being racy.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]