]> xenbits.xensource.com Git - libvirt.git/commit
nodedev: Return the parent for a virNodeDevicePtr struct
authorJohn Ferlan <jferlan@redhat.com>
Tue, 7 Feb 2017 18:04:08 +0000 (13:04 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 16 Feb 2017 17:23:04 +0000 (12:23 -0500)
commit4337bc57bea4bec352016df4ca10e77ddf259d77
tree4f2347fc61be402634c431f4bcbec8f9f08fb44f
parent1e6bc3c5811728b9f346afb6ca44bee19217ffc5
nodedev: Return the parent for a virNodeDevicePtr struct

When the 'parent' was added to the virNodeDevicePtr structure
by commit id 'e8a4ea75a' the 'parent' field was not properly filled
in when a virGetNodeDevice call was made within driver/config code.
Only the device name was ever filled in. Fetching the parent required
a second trip via virNodeDeviceGetParent into the node device lookup
code was required in order to retrieve the specific parent field (and
still the parent field was never filled in although it was free'd).

Since we have the data when we initially call virGetNodeDevice from
within driver/node_config code - let's just fill in the parent field
as well for anyone that wants it without requiring another trip into
the node_device lookup just to get the parent.

This will allow API's such as virConnectListAllNodeDevices,
virNodeDeviceLookupByName, and virNodeDeviceLookupSCSIHostByWWN
to retrieve both name and parent in the returned virNodeDevicePtr.

Signed-off-by: John Ferlan <jferlan@redhat.com>
src/conf/node_device_conf.c
src/node_device/node_device_driver.c
src/test/test_driver.c