Re: [PATCH 1/2] interface: Introduce netcfInterfaceObjIsActive

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

 



On 12/11/2013 05:41 AM, Michal Privoznik wrote:

>>> +static int
>>> +netcfInterfaceObjIsActive(struct netcf_if *iface,
>>> +                          bool *active)
>>> +{
>>> +    int ret = -1;
>>> +    unsigned int flags = 0;
>>> +
>>> +    virObjectRef(driverState);
>>
>> What's the ref / unref of driverState for ? The code you're
>> replacing doesn't do that, and AFAICT this shouldn't be
>> required since we're always calling this from public API
>> context
> 
> Well, for now it is not required, true. But I was thinking if somebody
> rewrites something this part wouldn't need any change as it's already
> foolproof. But I don't mind dropping ref and unref.

Spurious locking now for future code patches is counter-productive; if
someone adds code that needs locking, we can add the locking at that
point (and ideally keeping things lockless is the better approach).  So
yes, let's drop the ref and unref.

-- 
Eric Blake   eblake redhat com    +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]