vmm_controller: cleanup
Remove VmmController::stop method, which was not used anywhere in the
codebase. Return `DeviceIdNotFound` if rate limiter patch fails due
to not finding the net device with a specific net_iface_id attached
to the bus.
@@ -16,7 +16,7 @@ use rpc_interface::VmmActionError;
use vmm_config;
use vmm_config::drive::DriveError;
use vmm_config::machine_config::VmConfig;
-use vmm_config::net::NetworkInterfaceUpdateConfig;
+use vmm_config::net::{NetworkInterfaceError, NetworkInterfaceUpdateConfig};
use Vmm;
/// Shorthand result type for external VMM commands.
@@ -57,11 +57,6 @@ impl VmmController {
.map_err(VmmActionError::InternalVmm)
}
- /// Stops the inner Vmm and exits the process with the provided exit_code.
- pub fn stop(&mut self, exit_code: i32) {
- self.vmm.lock().unwrap().stop(exit_code)
- }
-
/// Creates a new `VmmController`.
pub fn new(vm_resources: VmResources, vmm: Arc<Mutex<Vmm>>) -> Self {
VmmController { vm_resources, vmm }
@@ -223,7 +218,9 @@ impl VmmController {
get_handler_arg!(tx_rate_limiter, ops),
);
} else {
- // TODO: Update this error after all devices have been ported.
+ return Err(VmmActionError::NetworkConfig(
+ NetworkInterfaceError::DeviceIdNotFound,
+ ));
}
Ok(())
