]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix disability to run on systems with no PCI bus
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 22 Apr 2011 12:24:54 +0000 (14:24 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 3 May 2011 11:46:22 +0000 (13:46 +0200)
The patch which moved libpciaccess initialization to one place caused
regression - we were not able to run on system with no PCI bus, like
s390(x).

src/node_device/node_device_udev.c

index 2139ef3fce757fc5c949e7c6a79df75673826d46..8cf0e82da6709e0e001d2c7f55c41399a433fc26 100644 (file)
@@ -1421,8 +1421,12 @@ static int udevDeviceMonitorShutdown(void)
         ret = -1;
     }
 
+#if defined __s390__ || defined __s390x_
+    /* Nothing was initialized, nothing needs to be cleaned up */
+#else
     /* pci_system_cleanup returns void */
     pci_system_cleanup();
+#endif
 
     return ret;
 }
@@ -1593,6 +1597,11 @@ static int udevDeviceMonitorStartup(int privileged)
     udevPrivate *priv = NULL;
     struct udev *udev = NULL;
     int ret = 0;
+
+#if defined __s390__ || defined __s390x_
+    /* On s390(x) system there is no PCI bus.
+     * Therefore there is nothing to initialize here. */
+#else
     int pciret;
 
     if ((pciret = pci_system_init()) != 0) {
@@ -1607,6 +1616,7 @@ static int udevDeviceMonitorStartup(int privileged)
             goto out;
         }
     }
+#endif
 
     if (VIR_ALLOC(priv) < 0) {
         virReportOOMError();