diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c index 50bb952bcb64cde3a4f342bdb5be365c7c7209a0..8a2e5fffa3390076f1f40d0eb66edc665517df52 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -429,6 +429,7 @@ static int udevProcessPCI(struct udev_device *device, virPCIDeviceAddress addr; virPCIEDeviceInfoPtr pci_express = NULL; virPCIDevicePtr pciDev = NULL; + udevPrivate *priv = driverState->privateData; int tmpGroup, ret = -1; char *p; int rc; @@ -544,7 +545,8 @@ static int udevProcessPCI(struct udev_device *device, data->pci_dev.function))) goto out; - if (virPCIDeviceIsPCIExpress(pciDev) > 0) { + /* We need to be root to read PCI device configs */ + if (priv->privileged && virPCIDeviceIsPCIExpress(pciDev) > 0) { if (VIR_ALLOC(pci_express) < 0) goto out;