]> xenbits.xensource.com Git - libvirt.git/commit
nodedev: Rework virNodeDeviceGetParentHost
authorJohn Ferlan <jferlan@redhat.com>
Tue, 24 Jan 2017 17:21:26 +0000 (12:21 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Sun, 19 Feb 2017 11:45:09 +0000 (06:45 -0500)
commit7ad479d0bd088f81defddb53622b858ab7f039db
treebf3d9921a5d6d20f49aa65e9c35e209041d6f09a
parentccb0d6e342ea87d43addb0330556f9f81e86db4c
nodedev: Rework virNodeDeviceGetParentHost

Rework the code to perform the various searches by parent, parent_wwnn/
parent_wwpn, parent_fabric_wwn, or vport capable in order to return the
'parent_host' number that is vHBA capable.

The former virNodeDeviceGetParentHost is renamed to add the ByParent
on it fixes an issue where if no parent was supplied in the XML to
create the vHBA, then virNodeDeviceFindByName was called with a NULL
second parameter which had bad results.

The reworked code will make the various calls to fetch the NPIV host
by the passed parameter options or if none are provided find a vport
capable NPIV HBA to perform the create. If the call is from the delete
path, then this option won't be allowed.

Each of virNodeDeviceGetParentHostBy* functions is now static, so
remove them external definitions.

A secondary benefit of this is the test_driver now can make use of
the new API to add some new tests to test the various creation options.
src/conf/node_device_conf.c
src/conf/node_device_conf.h
src/libvirt_private.syms
src/node_device/node_device_driver.c
src/test/test_driver.c