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