mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-22 11:22:26 +00:00
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 <sebastien.boeuf@intel.com>
This commit is contained in:
parent
aa638ead42
commit
948f808da6
@ -215,7 +215,7 @@ impl VmState {
|
||||
pub struct Vm {
|
||||
kernel: File,
|
||||
threads: Vec<thread::JoinHandle<()>>,
|
||||
devices: Arc<Mutex<DeviceManager>>,
|
||||
device_manager: Arc<Mutex<DeviceManager>>,
|
||||
config: Arc<Mutex<VmConfig>>,
|
||||
on_tty: bool,
|
||||
signals: Option<Signals>,
|
||||
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user