mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 13:45:20 +00:00
vm-virtio: pci: Add virtio_device() accessor
Add an accessor to return the underlying VirtioDevice. This is useful for managing the removal of the device from internal datastructures when handling virtio-pci device unplug. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
476e4ce24f
commit
2fa652aa4c
@ -564,6 +564,10 @@ impl VirtioPciDevice {
|
||||
self.write_bar(0, bar_offset as u64, data)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn virtio_device(&self) -> Arc<Mutex<dyn VirtioDevice>> {
|
||||
self.device.clone()
|
||||
}
|
||||
}
|
||||
|
||||
impl VirtioTransport for VirtioPciDevice {
|
||||
|
Loading…
Reference in New Issue
Block a user