From a2eab0033c6118e8b0a4fe47cf1aeaf4707a71a9 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Fri, 22 Apr 2011 14:24:54 +0200 Subject: [PATCH] Fix disability to run on systems with no PCI bus 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 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c index 2139ef3fce..8cf0e82da6 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -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(); -- GitLab