[libvirt] [PATCH] nodedev: Return the parent for a virNodeDevicePtr struct

John Ferlan jferlan at redhat.com
Thu Feb 9 19:23:47 UTC 2017



On 02/09/2017 07:39 AM, Bjoern Walk wrote:

[...]

>>                     }
>> diff --git a/src/test/test_driver.c b/src/test/test_driver.c
>> index 6820298..8dd738b 100644
>> --- a/src/test/test_driver.c
>> +++ b/src/test/test_driver.c
>> @@ -5450,7 +5450,10 @@ testNodeDeviceLookupByName(virConnectPtr conn,
>> const char *name)
>>         goto cleanup;
>>     }
>>
>> -    ret = virGetNodeDevice(conn, name);
>> +    if ((ret = virGetNodeDevice(conn, name))) {
>> +        if (VIR_STRDUP(ret->parent, obj->def->parent) < 0)
>> +            virObjectUnref(ret);
>> +    }
>>
>>  cleanup:
>>     if (obj)
>> @@ -5648,6 +5651,7 @@ testNodeDeviceCreateXML(virConnectPtr conn,
>>                                            0);
>>
>>     dev = virGetNodeDevice(conn, def->name);
>> +    ignore_value(VIR_STRDUP(def->parent, def->parent));
> 
> One of those should be dev probably.
> 

Oh right goog catch... It should be VIR_STRDUP(dev->parent, def->parent)

I've fixed in my local branch

John
>>     def = NULL;
>>  cleanup:
>>     testDriverUnlock(driver);
>> -- 
>> 2.7.4
>>
>> -- 
>> libvir-list mailing list
>> libvir-list at redhat.com
>> https://www.redhat.com/mailman/listinfo/libvir-list
>>
> 




More information about the libvir-list mailing list