Also look for dmi information in /sys/class

older kernels such as 2.6.26 have it there.
This commit is contained in:
Guido Günther 2010-01-07 10:13:51 +01:00
parent 28024f2311
commit 4c81b0fdc5
2 changed files with 7 additions and 1 deletions

View 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;

View 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