1. 07 6月, 2016 23 次提交
  2. 25 5月, 2016 1 次提交
    • A
      pci: Fix virPCIGetPhysicalFunction()'s callers · fc9ba9d5
      Andrea Bolognani 提交于
      Commit c8b1a836 changed the function, making it
      impossible for callers to be able to tell whether a
      non-negative return value means "physical function
      address found and parsed correctly" or "couldn't find
      corresponding physical function".
      
      The important difference between the two being that,
      in the latter case, the returned pointer is NULL and
      should never, ever be dereferenced.
      
      In order to cope with these changes, the callers
      have to be updated.
      fc9ba9d5
  3. 10 5月, 2016 1 次提交
  4. 19 3月, 2016 2 次提交
  5. 07 2月, 2016 1 次提交
  6. 25 11月, 2015 1 次提交
    • L
      nodedev: report maxCount for virtual_functions capability · f391889f
      Laine Stump 提交于
      A PCI device may have the capability to setup virtual functions (VFs)
      but have them currently all disabled. Prior to this patch, if that was
      the case the the node device XML for the device wouldn't report any
      virtual_functions capability.
      
      With this patch, if a file called "sriov_totalvfs" is found in the
      device's sysfs directory, its contents will be interpreted as a
      decimal number, and that value will be reported as "maxCount" in a
      capability element of the device's XML, e.g.:
      
         <capability type='virtual_functions' maxCount='7'/>
      
      This will be reported regardless of whether or not any VFs are
      currently enabled for the device.
      
      NB: sriov_numvfs (the number of VFs currently active) is also
      available in sysfs, but that value is implied by the number of items
      in the list that is inside the capability element, so there is no
      reason to explicitly provide it as an attribute.
      
      sriov_totalvfs and sriov_numvfs are available in kernels at least as far
      back as the 2.6.32 that is in RHEL6.7, but in the case that they
      simply aren't there, libvirt will behave as it did prior to this patch
      - no maxCount will be displayed, and the virtual_functions capability
      will be absent from the device's XML when 0 VFs are enabled.
      f391889f
  7. 18 6月, 2015 1 次提交
  8. 29 5月, 2015 1 次提交
    • L
      node_device: more informative error log when device isn't found · 06a18bc8
      Laine Stump 提交于
      In a couple of cases, the node device driver (and the test node device
      driver which likely copied it) was only logging "Node device not
      found" when it couldn't find the requested device. This patch changes
      those cases to log the name (and in the case when it's relevant, the
      wwnn and wwpn) as well.
      06a18bc8
  9. 22 5月, 2015 1 次提交
    • M
      node_device: fix libvirt build if WITH_HAL is defined · b903b3b0
      Maxim Nestratov 提交于
      commit ffc40b63 changed uniond _virNodeDevCapData into a typedef
      named virNodeDevCapData with a struct that contains the union as well
      as a type enum. This change necessitated changing every reference to
      "caps->type" into "caps->data.type", but the author of that patch
      failed to test a build "WITH_HAL". This patch fixes the one place in
      the hal backend that needed changing.
      b903b3b0
  10. 18 5月, 2015 6 次提交
    • L
      node_device: replace duplicated code in hal and udev backends · d52d7a64
      Laine Stump 提交于
      Both the hal and udev drivers call virPCI*() functions to the the
      SRIOV VF/PF info about PCI devices, and the UDEV backend calls
      virPCI*() to get IOMMU group info. Since there is now a single
      function call in node_device_linux_sysfs.c to do all of this, replace
      all that code in the two backends with calls to
      nodeDeviceSysfsGetPCIRelatedDevCaps().
      
      Note that this results in the HAL driver (probably) unnecessarily
      calling virPCIDevieAddressGetIOMMUGroupNum(), but in the case that the
      host doesn't support IOMMU groups, that function turns into a NOP (it
      returns -2, which causes the caller to skip the call to
      virPCIDeviceAddressGetIOMMUGroupAddresses()). So in the worst case it
      is a few extra cycles spent, and in the best case a mythical platform
      that supported IOMMU groups but used HAL rather than UDEV would gain
      proper reporting of IOMMU group info.
      d52d7a64
    • L
      node_device: update sriov/iommu info before dumpxml of a device · 601b0fa8
      Laine Stump 提交于
      Because reloading a PF driver with a different number of VFs doesn't
      result in any sort of event sent from udev to the libvirt node_device
      driver, libvirt's cache of that info can be out of date when a request
      arrives for the info about a device. To fix this, we refresh that data
      at the time of the dumpxml request, similar to what is already done
      for netdev link info and SCSI host capabilities.
      
      Since the same is true for iommu group information (for example, some
      other device in the same iommu group could have been detached from the
      host), we also create a function to update the iommu group info from
      sysfs, and a common function that does both. (a later patch will call
      this common function from the udev and hal backends).
      
      This resolves:
      
        https://bugzilla.redhat.com/show_bug.cgi?id=981546
      601b0fa8
    • L
      node_device: new functions to get sriov/iommu info from sysfs · 7349fa2e
      Laine Stump 提交于
      The udev and hal drivers both already call the same functions as these
      new functions added to node_device_linux_sysfs.c, but 1) we need to
      call them from node_device_driver.c, and 2) it would be nice to
      eliminate the duplicated code from the hal and udev backends.
      7349fa2e
    • L
      node device: prepare node_device_linux_sysfs.c to add more functions · d2a57815
      Laine Stump 提交于
      This file contains only a single function, detect_scsi_host_caps(),
      which is declared in node_device_driver.h and called from both the hal
      and udev backends. Other things common to the hal and udev drivers
      can be placed in that file though. As a prelude to adding further
      functions, this patch renames the existing function to something
      closer in line with other internal libvirt function names
      (nodeDeviceSysfsGetSCSIHostCaps()), and puts the declarations into a
      separate .h file.
      d2a57815
    • L
      nodedev: change if-else if in update_caps to switch · 3c93419b
      Laine Stump 提交于
      Makes it nicer as update bits are added for different cap types.
      3c93419b
    • L
      conf: make virNodeDevCapData an official type · ffc40b63
      Laine Stump 提交于
      For some reason a union (_virNodeDevCapData) that had only been
      declared inside the toplevel struct virNodeDevCapsDef was being used
      as an argument to functions all over the place. Since it was only a
      union, the "type" attribute wasn't necessarily sent with it. While
      this works, it just seems wrong.
      
      This patch creates a toplevel typedef for virNodeDevCapData and
      virNodeDevCapDataPtr, making it a struct that has the type attribute
      as a member, along with an anonymous union of everything that used to
      be in union _virNodeDevCapData. This way we only have to change the
      following:
      
        s/union _virNodeDevCapData */virNodeDevCapDataPtr /
      
      and
      
        s/caps->type/caps->data.type/
      
      This will make me feel less guilty when adding functions that need a
      pointer to one of these.
      ffc40b63
  11. 16 4月, 2015 1 次提交
  12. 15 4月, 2015 1 次提交