1. 25 3月, 2013 6 次提交
    • O
      nodedev: Fix the improper logic when enumerating SRIOV VF · 9a3ff01d
      Osier Yang 提交于
      virPCIGetVirtualFunctions returns 0 even if there is no "virtfn"
      entry under the device sysfs path.
      
      And virPCIGetVirtualFunctions returns -1 when it fails to get
      the PCI config space of one VF, however, with keeping the
      the VFs already detected.
      
      That's why udevProcessPCI and gather_pci_cap use logic like:
      
      if (!virPCIGetVirtualFunctions(syspath,
                                     &data->pci_dev.virtual_functions,
                                     &data->pci_dev.num_virtual_functions) ||
          data->pci_dev.num_virtual_functions > 0)
          data->pci_dev.flags |= VIR_NODE_DEV_CAP_FLAG_PCI_VIRTUAL_FUNCTION;
      
      to tag the PCI device with "virtual_function" cap.
      
      However, this results in a VF will aslo get "virtual_function" cap.
      
      This patch fixes it by:
        * Ignoring the VF which has failure of getting PCI config space
          (given that the successfully detected VFs are kept , it makes
          sense to not give up on the failure of one VF too) with a warning,
          so virPCIGetVirtualFunctions will not return -1 except out of memory.
      
        * Free the allocated *virtual_functions when out of memory
      
      And thus the logic can be changed to:
      
          /* Out of memory */
          int ret = virPCIGetVirtualFunctions(syspath,
                                              &data->pci_dev.virtual_functions,
                                              &data->pci_dev.num_virtual_functions);
      
          if (ret < 0 )
              goto out;
          if (data->pci_dev.num_virtual_functions > 0)
              data->pci_dev.flags |= VIR_NODE_DEV_CAP_FLAG_PCI_VIRTUAL_FUNCTION;
      9a3ff01d
    • O
      nodedev: Abstract nodeDeviceVportCreateDelete as util function · 96d3086a
      Osier Yang 提交于
      This abstracts nodeDeviceVportCreateDelete as an util function
      virManageVport, which can be further used by later storage patches
      (to support persistent vHBA, I don't want to create the vHBA
      using the public API, which is not good).
      96d3086a
    • O
      nodedev: Dump max vports and vports in use for HBA's XML · 448be8f7
      Osier Yang 提交于
      This enrichs HBA's xml by dumping the number of max vports and
      vports in use. Format is like:
      
        <capability type='vport_ops'>
          <max_vports>164</max_vports>
          <vports>5</vports>
        </capability>
      
      * docs/formatnode.html.in: (Document the new XML)
      * docs/schemas/nodedev.rng: (Add the schema)
      * src/conf/node_device_conf.h: (New member for data.scsi_host)
      * src/node_device/node_device_linux_sysfs.c: (Collect the value of
        max_vports and vports)
      448be8f7
    • O
      nodedev: Refactor the helpers · 4360a098
      Osier Yang 提交于
      This adds two util functions (virIsCapableFCHost and virIsCapableVport),
      and rename helper check_fc_host_linux as detect_scsi_host_caps,
      check_capable_vport_linux is removed, as it's abstracted to the util
      function virIsCapableVport. detect_scsi_host_caps nows detect both
      the fc_host and vport_ops capabilities. "stat(2)" is replaced with
      "access(2)" for saving.
      
      * src/util/virutil.h:
        - Declare virIsCapableFCHost and virIsCapableVport
      * src/util/virutil.c:
        - Implement virIsCapableFCHost and virIsCapableVport
      * src/node_device/node_device_linux_sysfs.c:
        - Remove check_capable_vport_linux
        - Rename check_fc_host_linux as detect_scsi_host_caps, and refactor
          it a bit to detect both fc_host and vport_os capabilities
      * src/node_device/node_device_driver.h:
        - Change/remove the related declarations
      * src/node_device/node_device_udev.c: (Use detect_scsi_host_caps)
      * src/node_device/node_device_hal.c: (Likewise)
      * src/node_device/node_device_driver.c (Likewise)
      4360a098
    • O
      nodedev: Use access instead of stat · d91f7dec
      Osier Yang 提交于
      The use of 'stat' in nodeDeviceVportCreateDelete is only to check
      if the file exists or not, it's a bit overkill, and safe to replace
      with the wrapper of access(2) (virFileExists).
      d91f7dec
    • O
      util: Add one helper virReadFCHost to read the value of fc_host entry · 244ce462
      Osier Yang 提交于
      "open_wwn_file" in node_device_linux_sysfs.c is redundant, on one
      hand it duplicates work of virFileReadAll, on the other hand, it's
      waste to use a function for it, as there is no other users of it.
      So I don't see why the file opening work cannot be done in
      "read_wwn_linux".
      
      "read_wwn_linux" can be abstracted as an util function. As what all
      it does is to read the sysfs entry.
      
      So this patch removes "open_wwn_file", and abstract "read_wwn_linux"
      as an util function "virReadFCHost" (a more general name, because
      after changes, it can read each of the fc_host entry now).
      
      * src/util/virutil.h: (Declare virReadFCHost)
      * src/util/virutil.c: (Implement virReadFCHost)
      * src/node_device/node_device_linux_sysfs.c: (Remove open_wwn_file,
        and read_wwn_linux)
      src/node_device/node_device_driver.h: (Remove the declaration of
        read_wwn_linux, and the related macros)
      src/libvirt_private.syms: (Export virReadFCHost)
      244ce462
  2. 12 2月, 2013 1 次提交
  3. 06 2月, 2013 2 次提交
  4. 14 1月, 2013 2 次提交
  5. 21 12月, 2012 7 次提交
  6. 04 12月, 2012 2 次提交
  7. 30 11月, 2012 1 次提交
  8. 02 11月, 2012 1 次提交
  9. 28 9月, 2012 2 次提交
  10. 21 9月, 2012 1 次提交
  11. 17 9月, 2012 1 次提交
    • O
      list: Implement listAllNodeDevices · c68cd62a
      Osier Yang 提交于
      This simply implements listAllNodeDevices using helper virNodeDeviceList
      
      src/node_device/node_device_driver.h:
        * Declare nodeListAllNodeDevices.
      
      src/node_device/node_device_driver.c:
        * Implement nodeListAllNodeDevices.
      
      src/node_device/node_device_hal.c:
        * Hook listAllNodeDevices to nodeListAllNodeDevices.
      
      src/node_device/node_device_udev.c
        * Hook listAllNodeDevices to nodeListAllNodeDevices.
      c68cd62a
  12. 23 7月, 2012 1 次提交
    • O
      Desert the FSF address in copyright · f9ce7dad
      Osier Yang 提交于
      Per the FSF address could be changed from time to time, and GNU
      recommends the following now: (http://www.gnu.org/licenses/gpl-howto.html)
      
        You should have received a copy of the GNU General Public License
        along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
      
      This patch removes the explicit FSF address, and uses above instead
      (of course, with inserting 'Lesser' before 'General').
      
      Except a bunch of files for security driver, all others are changed
      automatically, the copyright for securify files are not complete,
      that's why to do it manually:
      
        src/security/security_selinux.h
        src/security/security_driver.h
        src/security/security_selinux.c
        src/security/security_apparmor.h
        src/security/security_apparmor.c
        src/security/security_driver.c
      f9ce7dad
  13. 19 7月, 2012 2 次提交
  14. 28 6月, 2012 1 次提交
  15. 05 5月, 2012 1 次提交
    • S
      node_device: fix possible non-terminated string · 43d1616f
      Stefan Berger 提交于
      Error: STRING_NULL:
      /libvirt/src/node_device/node_device_linux_sysfs.c:80:
      string_null_argument: Function "saferead" does not terminate string "*buf".
      /libvirt/src/util/util.c:101:
      string_null_argument: Function "read" fills array "*buf" with a non-terminated string.
      /libvirt/src/node_device/node_device_linux_sysfs.c:87:
      string_null: Passing unterminated string "buf" to a function expecting a null-terminated string.
      43d1616f
  16. 20 4月, 2012 1 次提交
    • D
      The policy kit and HAL node device drivers both require a · 2223ea98
      Daniel P. Berrange 提交于
      DBus connection. The HAL device code further requires that
      the DBus connection is integrated with the event loop and
      provides such glue logic itself.
      
      The forthcoming FirewallD integration also requires a
      dbus connection with event loop integration. Thus we need
      to pull the current event loop glue out of the HAL driver.
      
      Thus we create src/util/virdbus.{c,h} files. This contains
      just one method virDBusGetSystemBus() which obtains a handle
      to the single shared system bus instance, with event glue
      automagically setup.
      2223ea98
  17. 10 4月, 2012 1 次提交
    • E
      build: avoid s390 compiler warnings · 9011a494
      Eric Blake 提交于
      I noticed these compiler warnings when building for the s390 architecture.
      
      * src/node_device/node_device_udev.c (udevDeviceMonitorStartup):
      Mark unused variable.
      * src/nodeinfo.c (linuxNodeInfoCPUPopulate): Avoid unused variable.
      9011a494
  18. 30 3月, 2012 1 次提交
  19. 10 2月, 2012 1 次提交
    • O
      npiv: Auto-generate WWN if it's not specified · 7c90026d
      Osier Yang 提交于
      The auto-generated WWN comply with the new addressing schema of WWN:
      
      <quote>
      the first nibble is either hex 5 or 6 followed by a 3-byte vendor
      identifier and 36 bits for a vendor-specified serial number.
      </quote>
      
      We choose hex 5 for the first nibble. And for the 3-bytes vendor ID,
      we uses the OUI according to underlying hypervisor type, (invoking
      virConnectGetType to get the virt type). e.g. If virConnectGetType
      returns "QEMU", we use Qumranet's OUI (00:1A:4A), if returns
      ESX|VMWARE, we use VMWARE's OUI (00:05:69). Currently it only
      supports qemu|xen|libxl|xenapi|hyperv|esx|vmware drivers. The last
      36 bits are auto-generated.
      7c90026d
  20. 07 12月, 2011 1 次提交
    • O
      npiv: Expose fabric_name outside · cc17f092
      Osier Yang 提交于
      This patch is to expose the fabric_name of fc_host class, which
      might be useful for users who wants to known which fabric the
      (v)HBA connects to.
      
      The patch also adds the missed capabilities' XML schema of scsi_host,
      (of course, with fabric_wwn added), and update the documents
      (docs/formatnode.html.in)
      cc17f092
  21. 12 11月, 2011 1 次提交
    • E
      build: drop useless dirent.h includes · e55ec69d
      Eric Blake 提交于
      * .gnulib: Update to latest, for improved syntax-check.
      * src/lxc/lxc_container.c (includes): Drop unused include.
      * src/network/bridge_driver.c: Likewise.
      * src/node_device/node_device_linux_sysfs.c: Likewise.
      * src/openvz/openvz_driver.c: Likewise.
      * src/qemu/qemu_conf.c: Likewise.
      * src/storage/storage_backend_iscsi.c: Likewise.
      * src/storage/storage_backend_mpath.c: Likewise.
      * src/uml/uml_conf.c: Likewise.
      * src/uml/uml_driver.c: Likewise.
      e55ec69d
  22. 14 10月, 2011 1 次提交
    • E
      build: add compiler attributes to virUUIDParse · 430156cf
      Eric Blake 提交于
      Coverity complained that most, but not all, clients of virUUIDParse
      were checking for errors.  Silence those coverity warnings by
      explicitly marking the cases where we trust the input, and fixing
      one instance that really should have been checking.  In particular,
      this silences a rather large percentage of the warnings I saw on my
      most recent Coverity analysis run.
      
      * src/util/uuid.h (virUUIDParse): Enforce rules.
      * src/util/uuid.c (virUUIDParse): Drop impossible check; at least
      Coverity will detect if we break rules and pass NULL.
      * src/xenapi/xenapi_driver.c (xenapiDomainCreateXML)
      (xenapiDomainLookupByID, xenapiDomainLookupByName)
      (xenapiDomainDefineXML): Ignore return when we trust data source.
      * src/vbox/vbox_tmpl.c (nsIDtoChar, vboxIIDToUUID_v3_x)
      (vboxCallbackOnMachineStateChange)
      (vboxCallbackOnMachineRegistered, vboxStoragePoolLookupByName):
      Likewise.
      * src/node_device/node_device_hal.c (gather_system_cap): Likewise.
      * src/xenxs/xen_sxpr.c (xenParseSxpr): Check for errors.
      430156cf
  23. 27 9月, 2011 1 次提交
  24. 08 9月, 2011 1 次提交