aboutsummaryrefslogtreecommitdiff
path: root/include/hw/vfio/vfio-common.h
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2017-07-10 10:39:43 -0600
committerAlex Williamson <alex.williamson@redhat.com>2017-07-10 10:39:43 -0600
commit7da624e26a4ef149927fe0ac187148f24306412f (patch)
tree92ec43e4ec0d25433e1e0ec65e6663954dd33294 /include/hw/vfio/vfio-common.h
parent6b06e3e49eb8c91cc286c16d6bf3181ac296f33d (diff)
vfio: Test realized when using VFIOGroup.device_list iterator
VFIOGroup.device_list is effectively our reference tracking mechanism such that we can teardown a group when all of the device references are removed. However, we also use this list from our machine reset handler for processing resets that affect multiple devices. Generally device removals are fully processed (exitfn + finalize) when this reset handler is invoked, however if the removal is triggered via another reset handler (piix4_reset->acpi_pcihp_reset) then the device exitfn may run, but not finalize. In this case we hit asserts when we start trying to access PCI helpers since much of the PCI state of the device is released. To resolve this, add a pointer to the Object DeviceState in our common base-device and skip non-realized devices as we iterate. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'include/hw/vfio/vfio-common.h')
-rw-r--r--include/hw/vfio/vfio-common.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
index 9521013d52..0b475a3596 100644
--- a/include/hw/vfio/vfio-common.h
+++ b/include/hw/vfio/vfio-common.h
@@ -115,6 +115,7 @@ typedef struct VFIODevice {
struct VFIOGroup *group;
char *sysfsdev;
char *name;
+ DeviceState *dev;
int fd;
int type;
bool reset_works;