diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2018-06-05 08:23:17 -0600 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2018-06-05 08:23:17 -0600 |
commit | 469d02de993817dcf4430d08fdff92aef8352d8f (patch) | |
tree | b68ab27a473aa68f93c0ce20e7ec2b8da10954d8 /hw/vfio/pci-quirks.c | |
parent | bcf3c3d029e73d54455e1d7a51177c37d668378c (diff) | |
download | qemu-469d02de993817dcf4430d08fdff92aef8352d8f.zip qemu-469d02de993817dcf4430d08fdff92aef8352d8f.tar.gz qemu-469d02de993817dcf4430d08fdff92aef8352d8f.tar.bz2 |
vfio/quirks: Add quirk reset callback
Quirks can be self modifying, provide a hook to allow them to cleanup
on device reset if desired.
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'hw/vfio/pci-quirks.c')
-rw-r--r-- | hw/vfio/pci-quirks.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c index cc3a74e..f0947cb 100644 --- a/hw/vfio/pci-quirks.c +++ b/hw/vfio/pci-quirks.c @@ -1694,6 +1694,21 @@ void vfio_bar_quirk_finalize(VFIOPCIDevice *vdev, int nr) /* * Reset quirks */ +void vfio_quirk_reset(VFIOPCIDevice *vdev) +{ + int i; + + for (i = 0; i < PCI_ROM_SLOT; i++) { + VFIOQuirk *quirk; + VFIOBAR *bar = &vdev->bars[i]; + + QLIST_FOREACH(quirk, &bar->quirks, next) { + if (quirk->reset) { + quirk->reset(vdev, quirk); + } + } + } +} /* * AMD Radeon PCI config reset, based on Linux: |