[libvirt] [PATCH] Remove hard dependency on DMI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The udev node device driver tries to glean a few tidbits of information
from /sys/devices/virtual/dmi/id.  If either the BIOS or the kernel does
not support DMI, libvirtd logs the error

  Failed to get udev device for syspath '/sys/devices/virtual/dmi/id' or '/sys/class/dmi/id'

and refuses to start.

This seems a bit extreme; information obtained from DMI, like the system
board vendor and BIOS version, is useful but not critical to libvirt's
operation.

This patch eliminates the hard dependency on DMI.  On systems without
DMI, libvirtd logs a warning, and leaves the "computer" node device's
properties empty.

Signed-off-by: Ed Swierk <eswierk@xxxxxxxxxxxxxxxxxx>

---
Index: libvirt-0.7.6/src/node_device/node_device_udev.c
===================================================================
--- libvirt-0.7.6.orig/src/node_device/node_device_udev.c
+++ libvirt-0.7.6/src/node_device/node_device_udev.c
@@ -1471,9 +1471,9 @@ static int udevSetupSystemDev(void)
     if (device == NULL) {
         device = udev_device_new_from_syspath(udev, DMI_DEVPATH_FALLBACK);
         if (device == NULL) {
-            VIR_ERROR("Failed to get udev device for syspath '%s' or '%s'",
-                      DMI_DEVPATH, DMI_DEVPATH_FALLBACK);
-            goto out;
+            VIR_WARN("Failed to get udev device for syspath '%s' or '%s'",
+                     DMI_DEVPATH, DMI_DEVPATH_FALLBACK);
+            goto out2;
         }
     }
 
@@ -1532,6 +1532,7 @@ static int udevSetupSystemDev(void)
 
     udev_device_unref(device);
 
+out2:
     dev = virNodeDeviceAssignDef(&driverState->devs, def);
     if (dev == NULL) {
         VIR_ERROR("Failed to create device for '%s'", def->name);


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]