[libvirt] [PATCH 1/2] interface: Introduce netcfInterfaceObjIsActive
Michal Privoznik
mprivozn at redhat.com
Wed Dec 11 12:41:26 UTC 2013
On 11.12.2013 13:19, Daniel P. Berrange wrote:
> On Wed, Dec 11, 2013 at 10:16:37AM +0100, Michal Privoznik wrote:
>> This function barely wraps ncf_if_status() and error handling code.
>>
>> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>> ---
>> src/interface/interface_backend_netcf.c | 57 +++++++++++++++++++--------------
>> 1 file changed, 33 insertions(+), 24 deletions(-)
>>
>> diff --git a/src/interface/interface_backend_netcf.c b/src/interface/interface_backend_netcf.c
>> index c4e18c4..2e681ec 100644
>> --- a/src/interface/interface_backend_netcf.c
>> +++ b/src/interface/interface_backend_netcf.c
>> @@ -238,6 +238,32 @@ static struct netcf_if *interfaceDriverGetNetcfIF(struct netcf *ncf, virInterfac
>> return iface;
>> }
>>
>> +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.
Michal
More information about the libvir-list
mailing list