提交 a2eab003 编写于 作者: M Michal Privoznik

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).
上级 0e7f7f85
...@@ -1421,8 +1421,12 @@ static int udevDeviceMonitorShutdown(void) ...@@ -1421,8 +1421,12 @@ static int udevDeviceMonitorShutdown(void)
ret = -1; 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 returns void */
pci_system_cleanup(); pci_system_cleanup();
#endif
return ret; return ret;
} }
...@@ -1593,6 +1597,11 @@ static int udevDeviceMonitorStartup(int privileged) ...@@ -1593,6 +1597,11 @@ static int udevDeviceMonitorStartup(int privileged)
udevPrivate *priv = NULL; udevPrivate *priv = NULL;
struct udev *udev = NULL; struct udev *udev = NULL;
int ret = 0; 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; int pciret;
if ((pciret = pci_system_init()) != 0) { if ((pciret = pci_system_init()) != 0) {
...@@ -1607,6 +1616,7 @@ static int udevDeviceMonitorStartup(int privileged) ...@@ -1607,6 +1616,7 @@ static int udevDeviceMonitorStartup(int privileged)
goto out; goto out;
} }
} }
#endif
if (VIR_ALLOC(priv) < 0) { if (VIR_ALLOC(priv) < 0) {
virReportOOMError(); virReportOOMError();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册