From 5788d365830588ee39ca0b23ec6620a680132b72 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Mon, 13 Jan 2020 23:17:57 +0100 Subject: [PATCH] vmm: Do not create virtio devices when missing a transport If neither PCI or MMIO are built in, we should not bother creating any virtio devices at all. When building a minimal VMM made of a kernel with an initramfs and a serial console, the RNG virtio device is still created even though there is no way it can ever get probed. Signed-off-by: Samuel Ortiz --- vmm/src/device_manager.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/vmm/src/device_manager.rs b/vmm/src/device_manager.rs index 37a5e61b5..577c663b5 100644 --- a/vmm/src/device_manager.rs +++ b/vmm/src/device_manager.rs @@ -453,6 +453,7 @@ impl DeviceManager { &mut virtio_devices, )?; + #[cfg(any(feature = "pci_support", feature = "mmio_support"))] virtio_devices.append(&mut DeviceManager::make_virtio_devices( vm_info, &address_manager,