pci: vfio_user: Free BARs associated with vfio-user device

This resolves an issue with hotplug -> removal -> hotplug of a vfio-user
device as the allocator was not updated with the now unused entries.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2021-08-25 16:26:19 +01:00 committed by Bo Chen
parent b075aada8c
commit e3487c0146

View File

@ -234,6 +234,10 @@ impl PciDevice for VfioUserPciDevice {
self.common.allocate_bars(allocator, &self.vfio_wrapper)
}
fn free_bars(&mut self, allocator: &mut SystemAllocator) -> Result<(), PciDeviceError> {
self.common.free_bars(allocator)
}
fn as_any(&mut self) -> &mut dyn Any {
self
}