From 948f808da64fc2d2f8451ea7bb96988b6434ee2b Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Wed, 4 Mar 2020 14:39:15 +0100 Subject: [PATCH] vm: Rename DeviceManager field in Vm structure It's more logical to name the field referring to the DeviceManager as "device_manager" instead of "devices". Signed-off-by: Sebastien Boeuf --- vmm/src/vm.rs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/vmm/src/vm.rs b/vmm/src/vm.rs index 88995b557..aa442a5ba 100755 --- a/vmm/src/vm.rs +++ b/vmm/src/vm.rs @@ -215,7 +215,7 @@ impl VmState { pub struct Vm { kernel: File, threads: Vec>, - devices: Arc>, + device_manager: Arc>, config: Arc>, on_tty: bool, signals: Option, @@ -376,7 +376,7 @@ impl Vm { Ok(Vm { kernel, - devices: device_manager, + device_manager, config, on_tty, threads: Vec::with_capacity(1), @@ -393,7 +393,7 @@ impl Vm { cmdline .insert_str(self.config.lock().unwrap().cmdline.args.clone()) .map_err(Error::CmdLineInsertStr)?; - for entry in self.devices.lock().unwrap().cmdline_additions() { + for entry in self.device_manager.lock().unwrap().cmdline_additions() { cmdline.insert_str(entry).map_err(Error::CmdLineInsertStr)?; } @@ -435,7 +435,7 @@ impl Vm { { rsdp_addr = Some(crate::acpi::create_acpi_tables( mem.deref(), - &self.devices, + &self.device_manager, &self.cpu_manager, &self.memory_manager, )); @@ -521,7 +521,7 @@ impl Vm { .resize(desired_vcpus) .map_err(Error::CpuManager)? { - self.devices + self.device_manager .lock() .unwrap() .notify_hotplug(HotPlugNotificationFlags::CPU_DEVICES_CHANGED) @@ -538,7 +538,7 @@ impl Vm { .resize(desired_memory) .map_err(Error::MemoryManager)? { - self.devices + self.device_manager .lock() .unwrap() .notify_hotplug(HotPlugNotificationFlags::MEMORY_DEVICES_CHANGED) @@ -554,7 +554,7 @@ impl Vm { #[cfg(feature = "pci_support")] { let device_cfg = self - .devices + .device_manager .lock() .unwrap() .add_device(_path) @@ -571,7 +571,7 @@ impl Vm { } } - self.devices + self.device_manager .lock() .unwrap() .notify_hotplug(HotPlugNotificationFlags::PCI_DEVICES_CHANGED) @@ -621,8 +621,8 @@ impl Vm { .start_boot_vcpus(entry_addr) .map_err(Error::CpuManager)?; - if self.devices.lock().unwrap().console().input_enabled() { - let console = self.devices.lock().unwrap().console().clone(); + if self.device_manager.lock().unwrap().console().input_enabled() { + let console = self.device_manager.lock().unwrap().console().clone(); let signals = Signals::new(&[SIGWINCH, SIGINT, SIGTERM]); match signals { Ok(signals) => { @@ -660,8 +660,8 @@ impl Vm { .read_raw(&mut out) .map_err(Error::Console)?; - if self.devices.lock().unwrap().console().input_enabled() { - self.devices + if self.device_manager.lock().unwrap().console().input_enabled() { + self.device_manager .lock() .unwrap() .console() @@ -699,7 +699,7 @@ impl Pausable for Vm { .map_err(|e| MigratableError::Pause(anyhow!("Invalid transition: {:?}", e)))?; self.cpu_manager.lock().unwrap().pause()?; - self.devices.lock().unwrap().pause()?; + self.device_manager.lock().unwrap().pause()?; *state = new_state; @@ -717,7 +717,7 @@ impl Pausable for Vm { .valid_transition(new_state) .map_err(|e| MigratableError::Pause(anyhow!("Invalid transition: {:?}", e)))?; - self.devices.lock().unwrap().resume()?; + self.device_manager.lock().unwrap().resume()?; self.cpu_manager.lock().unwrap().resume()?; // And we're back to the Running state.