2b13361 nodedev: Add the ability to create vHBA by parent wwnn/wwpn or fabric_wwn

Authored and Committed by John Ferlan 7 years ago
    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.
    
        
file modified
+24 -1
file modified
+126 -0
file modified
+14 -0
file modified
+2 -0