From 4c81b0fdc57b23d80b1b4752cd6143d15c02e9c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Thu, 7 Jan 2010 10:13:51 +0100 Subject: [PATCH] Also look for dmi information in /sys/class older kernels such as 2.6.26 have it there. --- src/node_device/node_device_udev.c | 7 ++++++- src/node_device/node_device_udev.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c index 22c5f2b4e3..7a9c1e5058 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -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; diff --git a/src/node_device/node_device_udev.h b/src/node_device/node_device_udev.h index 0fd39ae62f..6c83412c29 100644 --- a/src/node_device/node_device_udev.h +++ b/src/node_device/node_device_udev.h @@ -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