libvirt/src/node_device
John Ferlan 2b13361bc7 nodedev: Add the ability to create vHBA by parent wwnn/wwpn or fabric_wwn
https://bugzilla.redhat.com/show_bug.cgi?id=1349696

When creating a vHBA, the process is to feed XML to nodeDeviceCreateXML
that lists the <parent> scsi_hostX to use to create the vHBA. However,
between reboots, it's possible that the <parent> changes its scsi_hostX
to scsi_hostY and saved XML to perform the creation will either fail or
create a vHBA using the wrong parent.

So add the ability to provide "wwnn" and "wwpn" or "fabric_wwn" to
the <parent> instead of a name of the scsi_hostN that is the parent.
The allowed XML will thus be:

  <parent>scsi_host3</parent>  (current)

or

  <parent wwnn='$WWNN' wwpn='$WWPN'/>

or

  <parent fabric_wwn='$WWNN'/>

Using the wwnn/wwpn or fabric_wwn ensures the same 'scsi_hostN' is
selected between hardware reconfigs or host reboots. The fabric_wwn
Using the wwnn/wwpn pair will provide the most specific search option,
while fabric_wwn will at least ensure usage of the same SAN, but maybe
not the same scsi_hostN.

This patch will add the new fields to the nodedev.rng for input purposes
only since the input XML is essentially thrown away, no need to Format
the values since they'd already be printed as part of the scsi_host
data block.

New API virNodeDeviceGetParentHostByWWNs will take the parent "wwnn" and
"wwpn" in order to search the list of devices for matching capability
data fields wwnn and wwpn.

New API virNodeDeviceGetParentHostByFabricWWN will take the parent "fabric_wwn"
in order to search the list of devices for matching capability data field
fabric_wwn.
2017-01-06 17:14:12 -05:00
..
node_device_driver.c nodedev: Add the ability to create vHBA by parent wwnn/wwpn or fabric_wwn 2017-01-06 17:14:12 -05: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 maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
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