1. 21 2月, 2017 14 次提交
  2. 20 2月, 2017 9 次提交
  3. 19 2月, 2017 12 次提交
    • P
      165c76ac
    • J
      tests: Add createVHBAByNodeDevice-parent-fabric-wwn to fchosttest · f3b1b981
      John Ferlan 提交于
      Add a test that allows providing the parent fabric_wwn in the input XML
      in order to create the vHBA.
      
      This also fixes a mixed setting of the fabric_wwn field from the read
      test driver XML strings.
      f3b1b981
    • J
      nodedev: Rework virNodeDeviceGetParentHost · 7ad479d0
      John Ferlan 提交于
      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.
      7ad479d0
    • J
      nodedev: Keep the node device lock longer in nodeDeviceDestroy · ccb0d6e3
      John Ferlan 提交于
      While perhaps improbable, it could be possible that after finding our
      object that another thread running essentially in parallel could attempt
      to delete the same vHBA.
      
      So rather than dropping the lock right after finding the object, keep
      the lock around while we drop the object lock and work on deleting the
      object. Once the delete occurs we can safely drop the driver lock again.
      
      Cleanup some of the usage of cleanup instead out for the goto label.
      ccb0d6e3
    • J
      util: Move scsi_host specific functions from virutil · 03346def
      John Ferlan 提交于
      Create a virscsihost.c and place the functions there. That removes the
      last #ifdef __linux__ from virutil.c.
      
      Take the opporunity to also change the function names and in one case
      the parameters slightly
      03346def
    • J
      util: Replace virStoragePoolGetVhbaSCSIHostParent · d2d74a98
      John Ferlan 提交于
      Use the new virNodeDeviceGetParentName instead. Modify the callers to
      build the node device scsi_host# name string in order to call the new
      function so that proper lookup occurs.
      d2d74a98
    • J
      nodedev: Introduce virNodeDeviceGetParentName · aa6aa624
      John Ferlan 提交于
      Create a function which takes a node device "name" entry to lookup
      and returns a string containing the parent name for the node device.
      aa6aa624
    • J
      util: Create a new virvhba module and move/rename API's · 16416816
      John Ferlan 提交于
      Rather than have them mixed in with the virutil apis, create a separate
      virvhba.c module and move the vHBA related calls into there. Soon there
      will be more added.
      
      Also modify the names of the functions and some arguments to be more
      indicative of what is really happening. Adjust the callers respectively.
      
      While I was changing fchosttest, rather than the non-descriptive names
      test1...test6, rename them to match what the test is doing.
      16416816
    • J
      tests: Create a more realistic vHBA · 8729ce56
      John Ferlan 提交于
      Modify the code to react more like a real HBA -> vHBA creation.
      
      Currently the code would just modify the input XML definition to
      set the name to a wwpn and then modify the scsi_host capability
      entry for the defintion to change the scsi_host# and unique_id
      before adding that into the node device.
      
      This patch does things a bit better. It finds and copies a known
      existing vHBA (scsi_host11) in the node_device database and modifies
      that definition to change the name to scsi_host12 and set the wwnn/
      wwpn to what the input XML would expect before adding the def to the
      node device object list.
      
      Then rather than create a returned "dev" using the (poorly) mocked
      name - perform the lookup using the new device name.
      8729ce56
    • J
      test: Add helper to create vHBA for testNodeDeviceCreateXML · 0869d9b3
      John Ferlan 提交于
      Rather than inline the dummy creation of a vHBA to add to the node
      devices - create a helper to do that work.
      
      Also just tidy up a couple of things while at it...
      0869d9b3
    • J
      test: Add new NPIV capable HBA and a vHBA · 5c2ff641
      John Ferlan 提交于
      Predefine a second NPIV capable HBA as well as a vHBA using the first
      NPIV capable HBA. This will allow for a mechanism to perform more
      realistic create vHBA testing.
      5c2ff641
    • J
      tests: Alter test_driver HBA name/data to be closer to reality · 779e4905
      John Ferlan 提交于
      Alter "test-scsi-host-vport" to be "scsi_host1" to match the real
      environment. This is the vport capable HBA - IOW the NPIV device.
      Add more fields to scsi_host1 as well.
      
      Alter the XML being used by the objecttest to create a vHBA in order
      to match the scsi_host1 parent name and to use validateable wwnn/wwpn.
      This will allow for realistic testing.
      779e4905
  4. 18 2月, 2017 1 次提交
    • R
      nodedev: fix build with clang · d3ffa0ec
      Roman Bogorodskiy 提交于
      Build fails with:
      
      conf/node_device_conf.c:825:62: error: comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-compare]
          if ((data->drm.type = virNodeDevDRMTypeFromString(type)) < 0) {
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
      conf/node_device_conf.c:1801:59: error: comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-compare]
              if ((type = virNodeDevDevnodeTypeFromString(tmp)) < 0) {
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
      2 errors generated.
      
      Fix by using intermediate variable to store the result similarly
      to how it's done for other FromString* calls.
      d3ffa0ec
  5. 17 2月, 2017 4 次提交