From 2fa652aa4ce861f683378c3f8cbae4b978e2cf17 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 9 Apr 2020 11:44:48 +0100 Subject: [PATCH] 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 --- vm-virtio/src/transport/pci_device.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vm-virtio/src/transport/pci_device.rs b/vm-virtio/src/transport/pci_device.rs index 330e45b53..bdfce58ff 100755 --- a/vm-virtio/src/transport/pci_device.rs +++ b/vm-virtio/src/transport/pci_device.rs @@ -564,6 +564,10 @@ impl VirtioPciDevice { self.write_bar(0, bar_offset as u64, data) } } + + pub fn virtio_device(&self) -> Arc> { + self.device.clone() + } } impl VirtioTransport for VirtioPciDevice {