]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
node_device: udev: Use base 16 for product/vendor
authorCole Robinson <crobinso@redhat.com>
Tue, 12 Jan 2010 18:39:46 +0000 (13:39 -0500)
committerCole Robinson <crobinso@redhat.com>
Wed, 13 Jan 2010 12:02:18 +0000 (07:02 -0500)
udev doesn't prefix USB product/vendor info with '0x', so the
strtol conversions were wrong for the product field (vendor already
set the correct base). Make the change for PCI product/vendor as
well to be safe.

This fixes USB device assignment via virt-manager.

src/node_device/node_device_udev.c

index 7a9c1e505884d149fa80e5e7e21fc906e1cc7e5a..55cfee29e45747c6e22e596d1422219f5ed408b2 100644 (file)
@@ -457,14 +457,14 @@ static int udevProcessPCI(struct udev_device *device,
     if (udevGetUintSysfsAttr(device,
                              "vendor",
                              &data->pci_dev.vendor,
-                             0) == PROPERTY_ERROR) {
+                             16) == PROPERTY_ERROR) {
         goto out;
     }
 
     if (udevGetUintSysfsAttr(device,
                              "device",
                              &data->pci_dev.product,
-                             0) == PROPERTY_ERROR) {
+                             16) == PROPERTY_ERROR) {
         goto out;
     }
 
@@ -522,7 +522,7 @@ static int udevProcessUSBDevice(struct udev_device *device,
     if (udevGetUintProperty(device,
                             "ID_MODEL_ID",
                             &data->usb_dev.product,
-                            0) == PROPERTY_ERROR) {
+                            16) == PROPERTY_ERROR) {
         goto out;
     }