1. 07 1月, 2017 1 次提交
    • J
      nodedev: Add the ability to create vHBA by parent wwnn/wwpn or fabric_wwn · 2b13361b
      John Ferlan 提交于
      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.
      2b13361b
  2. 05 1月, 2017 1 次提交
  3. 14 10月, 2016 1 次提交
    • J
      util: Alter return value of virReadFCHost and fix mem leak · f29b13f8
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1357416
      
      Rather than return a 0 or -1 and the *result string, return just the result
      string to the caller.  Alter all the callers to handle the different return.
      
      As a side effect or result of this, it's much clearer that we cannot just
      assign the returned string into the scsi_host wwnn, wwpn, and fabric_wwn
      fields - rather we should fetch a temporary string, then as long as our
      fetch was good, VIR_FREE what may have been there, and STEAL what we just got.
      This fixes a memory leak in the virNodeDeviceCreateXML code path through
      find_new_device and nodeDeviceLookupSCSIHostByWWN which will continually
      call nodeDeviceSysfsGetSCSIHostCaps until the expected wwnn/wwpn is found
      in the device object capabilities.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      f29b13f8
  4. 12 10月, 2016 1 次提交
  5. 29 8月, 2016 1 次提交
    • R
      tests: fix segfault in objecteventtest · 61148074
      Roman Bogorodskiy 提交于
      Test 12 from objecteventtest (createXML add event) segaults on FreeBSD
      with bus error.
      
      At some point it calls testNodeDeviceDestroy() from the test driver. And
      it fails when it tries to unlock the device in the "out:" label of this
      function.
      
      Unlocking fails because the previous step was a call to
      virNodeDeviceObjRemove from conf/node_device_conf.c. This function
      removes the given device from the device list and cleans up the object,
      including destroying of its mutex. However, it does not nullify the pointer
      that was given to it.
      
      As a result, we end up in testNodeDeviceDestroy() here:
      
       out:
          if (obj)
              virNodeDeviceObjUnlock(obj);
      
      And instead of skipping this, we try to do Unlock and fail because of
      malformed mutex.
      
      Change virNodeDeviceObjRemove to use double pointer and set pointer to
      NULL.
      61148074
  6. 15 8月, 2016 1 次提交
    • J
      Introduce node device update event as top level event · 43a6b37b
      Jovanka Gulicoska 提交于
      This event is emitted when a nodedev XML definition is updated,
      like when cdrom media is changed in a cdrom block device.
      
      Also includes node device update event implementation for udev
      backend, virsh nodedev-event support, and event-test support
      43a6b37b
  7. 02 8月, 2016 2 次提交
  8. 08 6月, 2016 1 次提交
  9. 07 6月, 2016 31 次提交