]> git.ipfire.org Git - thirdparty/libvirt.git/commit
nodedev: Add the ability to create vHBA by parent wwnn/wwpn or fabric_wwn
authorJohn Ferlan <jferlan@redhat.com>
Thu, 17 Nov 2016 16:09:09 +0000 (11:09 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 6 Jan 2017 22:14:12 +0000 (17:14 -0500)
commit2b13361bc7c2b002835470c4d55d3a8deaadd906
tree5a2d4117f311e375028be0047409cecee8775c3f
parentd47db7b16dd5422c7e487c8c8ee5b181a2f9cd66
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.
docs/schemas/nodedev.rng
src/conf/node_device_conf.c
src/conf/node_device_conf.h
src/libvirt_private.syms
src/node_device/node_device_driver.c