From 1d61c476a155da2bd44d21f71602e134c0cd1f88 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Tue, 28 Apr 2020 15:59:08 +0100 Subject: [PATCH] vmm: device_manager: Add support for hotplugging virtio-vsock devices Create a new VirtioVsock device and add it to the PCI bus upon hotplug. Signed-off-by: Rob Bradford --- vmm/src/device_manager.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vmm/src/device_manager.rs b/vmm/src/device_manager.rs index 49081e134..c0c727560 100644 --- a/vmm/src/device_manager.rs +++ b/vmm/src/device_manager.rs @@ -2335,6 +2335,12 @@ impl DeviceManager { let (device, iommu_attached, id) = self.make_virtio_net_device(net_cfg)?; self.hotplug_virtio_pci_device(device, iommu_attached, id) } + + #[cfg(feature = "pci_support")] + pub fn add_vsock(&mut self, vsock_cfg: &mut VsockConfig) -> DeviceManagerResult<()> { + let (device, iommu_attached, id) = self.make_virtio_vsock_device(vsock_cfg)?; + self.hotplug_virtio_pci_device(device, iommu_attached, id) + } } #[cfg(feature = "acpi")]