vfio: fix duplicate function call
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 <caoj.fnst@cn.fujitsu.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
This commit is contained in:
parent
31e6a7b17b
commit
893bfc3cc8
@ -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");
|
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;
|
vdev->vbasedev.needs_reset = false;
|
||||||
|
|
||||||
info = g_malloc0(sizeof(*info));
|
info = g_malloc0(sizeof(*info));
|
||||||
@ -2109,7 +2111,9 @@ out:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
out_single:
|
out_single:
|
||||||
vfio_pci_post_reset(vdev);
|
if (!single) {
|
||||||
|
vfio_pci_post_reset(vdev);
|
||||||
|
}
|
||||||
g_free(info);
|
g_free(info);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user