From ed005221ffb6f2807c94543cf869450ed7ad2e03 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 30 Jun 2010 15:57:54 -0400 Subject: [PATCH] udev: Parse PCI devices even if libpciaccess fails We only use libpciaccess for resolving device product/vendor. If initializing the library fails (say if using qemu:///session), don't warn so loudly, and carry on as usual. --- src/node_device/node_device_udev.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c index 73217c5e0c..02e44a1cde 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -363,12 +363,15 @@ static int udevTranslatePCIIds(unsigned int vendor, char **vendor_string, char **product_string) { - int ret = -1; + int ret = -1, pciret; struct pci_id_match m; const char *vendor_name = NULL, *device_name = NULL; - if (pci_system_init() != 0) { - VIR_ERROR0(_("Failed to initialize libpciaccess")); + if ((pciret = pci_system_init()) != 0) { + char ebuf[256]; + VIR_INFO("Failed to initialize libpciaccess: %s", + virStrerror(pciret, ebuf, sizeof ebuf)); + ret = 0; goto out; } -- GitLab