vfio-pci: Implement PCI hot reset
commitf16f39c3fc973c5d7cbc2224eefb4ef5eb1e64ff
authorAlex Williamson <alex.williamson@redhat.com>
Wed, 2 Oct 2013 19:51:00 +0000 (2 13:51 -0600)
committerAlex Williamson <alex.williamson@redhat.com>
Wed, 2 Oct 2013 19:51:00 +0000 (2 13:51 -0600)
tree42ce5131f2a78734fcc4a8fd7d1a50be5652b2c2
parent8fbf47c3a8a7f37a11268a07290d20a325ba4cb6
vfio-pci: Implement PCI hot reset

Now that VFIO has a PCI hot reset interface, take advantage of it.
There are two modes that we need to consider.  The first is when only
one device within the set of devices affected is actually assigned to
the guest.  In this case the other devices are are just held by VFIO
for isolation and we can pretend they're not there, doing an entire
bus reset whenever the device reset callback is triggered.  Supporting
this case separately allows us to do the best reset we can do of the
device even if the device is hotplugged.

The second mode is when multiple affected devices are all exposed to
the guest.  In this case we can only do a hot reset when the entire
system is being reset.  However, this also allows us to track which
individual devices are affected by a reset and only do them once.

We split our reset function into pre- and post-reset helper functions
prioritize the types of device resets available to us, and create
separate _one vs _multi reset interfaces to handle the distinct cases
above.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
hw/misc/vfio.c