[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 19/19] vfio: fix duplicate function call
From: |
Alex Williamson |
Subject: |
[Qemu-devel] [PULL 19/19] vfio: fix duplicate function call |
Date: |
Mon, 17 Oct 2016 13:54:34 -0600 |
User-agent: |
StGit/0.17.1-dirty |
From: Cao jin <address@hidden>
When vfio device is reset(encounter FLR, or bus reset), if need to do
bus reset(vfio_pci_hot_reset_one is called), vfio_pci_pre_reset &
vfio_pci_post_reset will be called twice.
Signed-off-by: Cao jin <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>
---
hw/vfio/pci.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index fef436a..65d30fd 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -1951,7 +1951,9 @@ static int vfio_pci_hot_reset(VFIOPCIDevice *vdev, bool
single)
trace_vfio_pci_hot_reset(vdev->vbasedev.name, single ? "one" : "multi");
- vfio_pci_pre_reset(vdev);
+ if (!single) {
+ vfio_pci_pre_reset(vdev);
+ }
vdev->vbasedev.needs_reset = false;
info = g_malloc0(sizeof(*info));
@@ -2109,7 +2111,9 @@ out:
}
}
out_single:
- vfio_pci_post_reset(vdev);
+ if (!single) {
+ vfio_pci_post_reset(vdev);
+ }
g_free(info);
return ret;
- [Qemu-devel] [PULL 09/19] vfio: Pass an error object to vfio_get_group, (continued)
- [Qemu-devel] [PULL 09/19] vfio: Pass an error object to vfio_get_group, Alex Williamson, 2016/10/17
- [Qemu-devel] [PULL 10/19] vfio: Pass an error object to vfio_get_device, Alex Williamson, 2016/10/17
- [Qemu-devel] [PULL 11/19] vfio/platform: Pass an error object to vfio_populate_device, Alex Williamson, 2016/10/17
- [Qemu-devel] [PULL 12/19] vfio/platform: fix a wrong returned value in vfio_populate_device, Alex Williamson, 2016/10/17
- [Qemu-devel] [PULL 13/19] vfio/platform: Pass an error object to vfio_base_device_init, Alex Williamson, 2016/10/17
- [Qemu-devel] [PULL 14/19] vfio/pci: Conversion to realize, Alex Williamson, 2016/10/17
- [Qemu-devel] [PULL 15/19] vfio/pci: Remove vfio_msix_early_setup returned value, Alex Williamson, 2016/10/17
- [Qemu-devel] [PULL 16/19] vfio/pci: Remove vfio_populate_device returned value, Alex Williamson, 2016/10/17
- [Qemu-devel] [PULL 17/19] vfio/pci: Handle host oversight, Alex Williamson, 2016/10/17
- [Qemu-devel] [PULL 18/19] vfio/pci: Fix vfio_rtl8168_quirk_data_read address offset, Alex Williamson, 2016/10/17
- [Qemu-devel] [PULL 19/19] vfio: fix duplicate function call,
Alex Williamson <=
- Re: [Qemu-devel] [PULL 00/19] VFIO updates 2016-10-17, Peter Maydell, 2016/10/18