libvirt/src/node_device
John Ferlan f29b13f830 util: Alter return value of virReadFCHost and fix mem leak
https://bugzilla.redhat.com/show_bug.cgi?id=1357416

Rather than return a 0 or -1 and the *result string, return just the result
string to the caller.  Alter all the callers to handle the different return.

As a side effect or result of this, it's much clearer that we cannot just
assign the returned string into the scsi_host wwnn, wwpn, and fabric_wwn
fields - rather we should fetch a temporary string, then as long as our
fetch was good, VIR_FREE what may have been there, and STEAL what we just got.
This fixes a memory leak in the virNodeDeviceCreateXML code path through
find_new_device and nodeDeviceLookupSCSIHostByWWN which will continually
call nodeDeviceSysfsGetSCSIHostCaps until the expected wwnn/wwpn is found
in the device object capabilities.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2016-10-14 06:47:36 -04:00
..
node_device_driver.c node_device: implement node device lifecycle event APIs 2016-08-02 09:52:00 -04:00
node_device_driver.h node_device: implement node device lifecycle event APIs 2016-08-02 09:52:00 -04:00
node_device_hal.c tests: fix segfault in objecteventtest 2016-08-29 13:51:56 +03:00
node_device_hal.h
node_device_linux_sysfs.c util: Alter return value of virReadFCHost and fix mem leak 2016-10-14 06:47:36 -04:00
node_device_linux_sysfs.h node_device: new functions to get sriov/iommu info from sysfs 2015-05-18 10:31:58 -04:00
node_device_udev.c Change virDomainEventState to virObjectLockable 2016-10-12 12:54:47 +02:00
node_device_udev.h Remove PROPERTY_* constants 2016-06-07 12:53:37 +02:00