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
1 changed files with 4 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue