[libvirt] [PATCH] virpci:fix Secondary Bus Reset bug

hexin900110 at 163.com hexin900110 at 163.com
Thu Aug 15 09:44:06 UTC 2019


From: hexin <hexin15 at baidu.com>

The parent bridge configuration of the current device
should be read and reset, instead of reading the current
device configuration.

Signed-off-by: He Xin <hexin15 at baidu.com>
Signed-off-by: Liu Qi <liuqi16 at baidu.com>
Signed-off-by: Zhang Yu <zhangyu31 at baidu.com>
---
 src/util/virpci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virpci.c b/src/util/virpci.c
index 61a6b359e5..483de2cb16 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -821,7 +821,7 @@ virPCIDeviceTrySecondaryBusReset(virPCIDevicePtr dev,
     /* Read the control register, set the reset flag, wait 200ms,
      * unset the reset flag and wait 200ms.
      */
-    ctl = virPCIDeviceRead16(dev, cfgfd, PCI_BRIDGE_CONTROL);
+    ctl = virPCIDeviceRead16(dev, parentfd, PCI_BRIDGE_CONTROL);
 
     virPCIDeviceWrite16(parent, parentfd, PCI_BRIDGE_CONTROL,
                         ctl | PCI_BRIDGE_CTL_RESET);
-- 
2.22.0




More information about the libvir-list mailing list