]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virpci:fix Secondary Bus Reset bug
authorhexin <hexin15@baidu.com>
Thu, 15 Aug 2019 09:44:06 +0000 (17:44 +0800)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 16 Aug 2019 08:47:26 +0000 (10:47 +0200)
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@baidu.com>
Signed-off-by: Liu Qi <liuqi16@baidu.com>
Signed-off-by: Zhang Yu <zhangyu31@baidu.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virpci.c

index 7ca755c1a80dab2041b07ded7bb64b396852d4e8..4c7c26f9814ea90edb515171cc2fb877131386ab 100644 (file)
@@ -839,7 +839,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);