diff --git a/vm_control/src/client.rs b/vm_control/src/client.rs index a7fa42fa64..bb164149ab 100644 --- a/vm_control/src/client.rs +++ b/vm_control/src/client.rs @@ -8,7 +8,6 @@ use std::path::PathBuf; #[cfg(feature = "pci-hotplug")] use anyhow::anyhow; -#[cfg(feature = "pci-hotplug")] use anyhow::Result as AnyHowResult; use base::open_file_or_duplicate; use remain::sorted; @@ -73,6 +72,15 @@ pub fn do_net_add + std::fmt::Debug>( } } +#[cfg(not(feature = "pci-hotplug"))] +/// Send a `VmRequest` for PCI hotplug that expects `VmResponse::PciResponse::AddOk(bus)` +pub fn do_net_add + std::fmt::Debug>( + _tap_name: &str, + _socket_path: T, +) -> AnyHowResult { + bail!("Unsupported: pci-hotplug feature disabled"); +} + #[cfg(feature = "pci-hotplug")] /// Send a `VmRequest` for removing hotplugged PCI device that expects `VmResponse::Ok` pub fn do_net_remove + std::fmt::Debug>( @@ -87,6 +95,15 @@ pub fn do_net_remove + std::fmt::Debug>( } } +#[cfg(not(feature = "pci-hotplug"))] +/// Send a `VmRequest` for removing hotplugged PCI device that expects `VmResponse::Ok` +pub fn do_net_remove + std::fmt::Debug>( + _bus_num: u8, + _socket_path: T, +) -> AnyHowResult<()> { + bail!("Unsupported: pci-hotplug feature disabled"); +} + pub fn do_usb_attach + std::fmt::Debug>( socket_path: T, dev_path: &Path,