1. 16 12月, 2015 1 次提交
    • D
      avoid using deprecated udev logging functions · acb00b7a
      Daniel P. Berrange 提交于
      In systemd >= 218, the udev_set_log_fn method has been marked
      deprecated and turned into a no-op. Nothing in the udev client
      library will print to stderr by default anymore, so we can
      just stop installing a logging hook for new enough udev.
      
      (cherry picked from commit a93a3b97)
      acb00b7a
  2. 08 4月, 2014 1 次提交
  3. 29 3月, 2014 1 次提交
  4. 25 3月, 2014 1 次提交
  5. 21 3月, 2014 1 次提交
  6. 18 3月, 2014 2 次提交
  7. 10 3月, 2014 1 次提交
  8. 21 11月, 2013 1 次提交
    • E
      maint: fix comma style issues: remaining code · e44a9a70
      Eric Blake 提交于
      Most of our code base uses space after comma but not before;
      fix the remaining uses before adding a syntax check.
      
      * src/network/bridge_driver.c: Consistently use commas.
      * src/node_device/node_device_hal.c: Likewise.
      * src/node_device/node_device_udev.c: Likewise.
      * src/storage/storage_backend_rbd.c: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      e44a9a70
  9. 01 11月, 2013 1 次提交
    • R
      nodedev_hal: fix segfault when virDBusGetSystemBus fails · 87176d0c
      Ryota Ozaki 提交于
      Thie patch fixes the segfault:
          error : nodeStateInitialize:658 : DBus not available,
            disabling HAL driver: internal error: Unable to get DBus
            system bus connection: Failed to connect to socket
            /var/run/dbus/system_bus_socket: No such file or directory
          error : nodeStateInitialize:719 :  ?:
          Caught Segmentation violation dumping internal log buffer:
      
      This segfault occurs at the below VIR_ERROR:
        failure:
            if (dbus_error_is_set(&err)) {
                VIR_ERROR(_("%s: %s"), err.name, err.message);
      
      When virDBusGetSystemBus fails, the code jumps to the above failure
      path. However, the err variable is not correctly initialized
      before calling virDBusGetSystemBus. As a result, dbus_error_is_set
      may pass over the uninitialized err variable whose name or
      message may point to somewhere unknown memory region, which
      causes a segfault on VIR_ERROR.
      
      The new code initializes the err variable before calling
      virDBusGetSystemBus.
      Signed-off-by: NRyota Ozaki <ozaki.ryota@gmail.com>
      87176d0c
  10. 05 9月, 2013 1 次提交
  11. 11 7月, 2013 1 次提交
  12. 10 7月, 2013 1 次提交
  13. 03 7月, 2013 1 次提交
  14. 01 7月, 2013 1 次提交
    • L
      node device driver: update driver name during dumpxml · 374c5e4f
      Laine Stump 提交于
      This fixes:
      
        https://bugzilla.redhat.com/show_bug.cgi?id=979290
        https://bugzilla.redhat.com/show_bug.cgi?id=979330
      
      The node device driver was written with the assumption that udev would
      use a "change" event to notify libvirt of any change to device status
      (including the name of the driver it was bound to). It turns out this
      is not the case (see Comment 4 of BZ 979290). That means that a
      dumpxml for a device would always show whatever driver happened to be
      bound at the time libvirt was started (when the node device cache was
      built).
      
      There was already code in the driver (for the benefit of the HAL
      backend) that updated the driver name from sysfs each time a device's
      info was retrieved from the cache. This patch just enables that manual
      update for the udev backend as well.
      374c5e4f
  15. 27 6月, 2013 1 次提交
    • L
      nodedev: add iommuGroup to node device object · 8807b285
      Laine Stump 提交于
      This includes adding it to the nodedev parser and formatter, docs, and
      test.
      
      An example of the new iommuGroup element that is a part of the output
      from "virsh nodedev-dumpxml" (virNodeDeviceGetXMLDesc()):
      
        <device>
          <name>pci_0000_02_00_1</name>
          <capability type='pci'>
          ...
            <iommuGroup number='12'>
              <address domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
              <address domain='0x0000' bus='0x02' slot='0x00' function='0x1'/>
            </iommuGroup>
          </capability>
        </device>
      8807b285
  16. 24 6月, 2013 1 次提交
  17. 18 6月, 2013 4 次提交
    • O
      nodedev_hal: Enumerate scsi generic device · dd451f3a
      Osier Yang 提交于
      The xml outputed by HAL backend for scsi generic device:
      
      <device>
        <name>pci_8086_2922_scsi_host_scsi_device_lun0_scsi_generic</name>
        <path>/sys/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/scsi_generic/sg0</path>
        <parent>pci_8086_2922_scsi_host_scsi_device_lun0</parent>
        <capability type='scsi_generic'>
          <char>/dev/sg0</char>
        </capability>
      </device>
      dd451f3a
    • O
      nodedev_udev: Enumerate scsi generic device · 92fd4c09
      Osier Yang 提交于
      Since scsi generic device doesn't have DEVTYPE property set, the
      only way to know if it's a  scsi generic device or not is to read
      the "SUBSYSTEM" property.
      
      The XML of the scsi generic device will be like:
      
      <device>
        <name>scsi_generic_sg0</name>
        <path>/sys/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/scsi_generic/sg0</path>
        <parent>scsi_0_0_0_0</parent>
        <capability type='scsi_generic'>
          <char>/dev/sg0</char>
        </capability>
      </device>
      92fd4c09
    • O
      nodedev_udev: changes missed by commit 1aa0ba3c · bf5fbf8f
      Osier Yang 提交于
      bf5fbf8f
    • O
      nodedev_udev: Refactor udevGetDeviceType · 1aa0ba3c
      Osier Yang 提交于
      Checking if the "devtype" is NULL along with each "if" statements
      is bad. It wastes the performance, and also not good for reading.
      And also when the "devtype" is NULL, the logic is also not clear.
      
      This reorgnizes the logic of with "if...else" and a bunch of "else if".
      
      Other changes:
         * Change the function style.
         * Remove the useless debug statement.
         * Get rid of the goto
         * New helper udevDeviceHasProperty to simplify the logic for checking
           if a property is existing for the device.
         * Add comment to clarify "PCI devices don't set the DEVTYPE property"
         * s/sysfs path/sysfs name/, as udev_device_get_sysname returns the
           name instead of the full path. E.g. "sg0"
         * Refactor the comment for setting VIR_NODE_DEV_CAP_NET cap type
           a bit.
      1aa0ba3c
  18. 14 6月, 2013 1 次提交
  19. 12 6月, 2013 1 次提交
  20. 03 6月, 2013 1 次提交
  21. 21 5月, 2013 1 次提交
  22. 13 5月, 2013 2 次提交
  23. 11 5月, 2013 1 次提交
    • L
      util: move virFile* functions from virutil.c to virfile.c · bfe7721d
      Laine Stump 提交于
      These all existed before virfile.c was created, and for some reason
      weren't moved.
      
      This is mostly straightfoward, although the syntax rule prohibiting
      write() had to be changed to have an exception for virfile.c instead
      of virutil.c.
      
      This movement pointed out that there is a function called
      virBuildPath(), and another almost identical function called
      virFileBuildPath(). They really should be a single function, which
      I'll take care of as soon as I figure out what the arglist should look
      like.
      bfe7721d
  24. 09 5月, 2013 1 次提交
  25. 08 5月, 2013 1 次提交
  26. 03 5月, 2013 2 次提交
  27. 02 5月, 2013 1 次提交
    • M
      virutil: Move string related functions to virstring.c · 7c9a2d88
      Michal Privoznik 提交于
      The source code base needs to be adapted as well. Some files
      include virutil.h just for the string related functions (here,
      the include is substituted to match the new file), some include
      virutil.h without any need (here, the include is removed), and
      some require both.
      7c9a2d88
  28. 26 4月, 2013 1 次提交
    • E
      build: avoid unsafe functions in libgen.h · 1fbf1905
      Eric Blake 提交于
      POSIX says that both basename() and dirname() may return static
      storage (aka they need not be thread-safe); and that they may but
      not must modify their input argument.  Furthermore, <libgen.h>
      is not available on all platforms.  For these reasons, you should
      never use these functions in a multi-threaded library.
      
      Gnulib instead recommends a way to avoid the portability nightmare:
      gnulib's "dirname.h" provides useful thread-safe counterparts.  The
      obvious dir_name() and base_name() are GPL (because they malloc(),
      but call exit() on failure) so we can't use them; but the LGPL
      variants mdir_name() (malloc's or returns NULL) and last_component
      (always points into the incoming string without modifying it,
      differing from basename semantics only on corner cases like the
      empty string that we shouldn't be hitting in the first place) are
      already in use in libvirt.  This finishes the swap over to the safe
      functions.
      
      * cfg.mk (sc_prohibit_libgen): New rule.
      * src/util/vircgroup.c: Fix offenders.
      * src/parallels/parallels_storage.c (parallelsPoolAddByDomain):
      Likewise.
      * src/parallels/parallels_network.c (parallelsGetBridgedNetInfo):
      Likewise.
      * src/node_device/node_device_udev.c (udevProcessSCSIHost)
      (udevProcessSCSIDevice): Likewise.
      * src/storage/storage_backend_disk.c
      (virStorageBackendDiskDeleteVol): Likewise.
      * src/util/virpci.c (virPCIGetDeviceAddressFromSysfsLink):
      Likewise.
      * src/util/virstoragefile.h (_virStorageFileMetadata): Avoid false
      positive.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1fbf1905
  29. 25 4月, 2013 1 次提交
  30. 24 4月, 2013 4 次提交
  31. 04 4月, 2013 1 次提交
    • D
      Add support for SD cards in nodedev driver · e2b373e6
      Daniel P. Berrange 提交于
      The nodedev driver currently only detects harddisk, cdrom
      and floppy devices. This adds support for SD cards, which
      are common storage for ARM devices, eg the Google ChromeBook
      
      <device>
        <name>block_mmcblk0_0xb1c7c08b</name>
        <parent>computer</parent>
        <capability type='storage'>
          <block>/dev/mmcblk0</block>
          <drive_type>sd</drive_type>
          <serial>0xb1c7c08b</serial>
          <size>15758000128</size>
          <logical_block_size>512</logical_block_size>
          <num_blocks>30777344</num_blocks>
        </capability>
      </device>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      e2b373e6