vfio-pci: Attempt bus/slot reset on release

Each time a device is released, mark whether a local reset was
successful or whether a bus/slot reset is needed.  If a reset is
needed and all of the affected devices are bound to vfio-pci and
unused, allow the reset.  This is most useful when the userspace
driver is killed and releases all the devices in an unclean state,
such as when a QEMU VM quits.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
This commit is contained in:
Alex Williamson
2014-08-07 11:12:07 -06:00
parent 61d792562b
commit bc4fba7712
2 changed files with 113 additions and 0 deletions

View File

@@ -54,6 +54,7 @@ struct vfio_pci_device {
bool extended_caps;
bool bardirty;
bool has_vga;
bool needs_reset;
struct pci_saved_state *pci_saved_state;
int refcnt;
struct eventfd_ctx *err_trigger;