]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Also look for dmi information in /sys/class
authorGuido Günther <agx@sigxcpu.org>
Thu, 7 Jan 2010 09:13:51 +0000 (10:13 +0100)
committerGuido Günther <agx@sigxcpu.org>
Mon, 11 Jan 2010 11:49:35 +0000 (12:49 +0100)
older kernels such as 2.6.26 have it there.

src/node_device/node_device_udev.c
src/node_device/node_device_udev.h

index 22c5f2b4e3dad74a5990f2c24707ec4f0c4809b5..7a9c1e505884d149fa80e5e7e21fc906e1cc7e5a 100644 (file)
@@ -1407,7 +1407,12 @@ static int udevSetupSystemDev(void)
     device = udev_device_new_from_syspath(udev, DMI_DEVPATH);
     if (device == NULL) {
         VIR_ERROR("Failed to get udev device for syspath '%s'\n", DMI_DEVPATH);
-        goto out;
+
+        device = udev_device_new_from_syspath(udev, DMI_DEVPATH_FALLBACK);
+        if (device == NULL) {
+            VIR_ERROR("Failed to get udev device for syspath '%s'\n", DMI_DEVPATH_FALLBACK);
+            goto out;
+        }
     }
 
     data = &def->caps->data;
index 0fd39ae62f02cec7b9d81fa64c54d6c7e7d91a23..6c83412c2915f6f053f688cec6544f9fc72f260c 100644 (file)
@@ -26,6 +26,7 @@
 #define SYSFS_DATA_SIZE 4096
 #define DRV_STATE_UDEV_MONITOR(ds) ((struct udev_monitor *)((ds)->privateData))
 #define DMI_DEVPATH "/sys/devices/virtual/dmi/id"
+#define DMI_DEVPATH_FALLBACK "/sys/class/dmi/id"
 #define PROPERTY_FOUND 0
 #define PROPERTY_MISSING 1
 #define PROPERTY_ERROR -1