From: hexin <hexi...@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 <hexi...@baidu.com>
Signed-off-by: Liu Qi <liuq...@baidu.com>
Signed-off-by: Zhang Yu <zhangy...@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

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to