From f1276c58d27fbfdb18c2dcac0e79bf3aeabd8f7c Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 28 Apr 2022 15:21:14 +0100 Subject: [PATCH] vmm: Commandline inject from devices is aarch64 specific This is not required for x86_64 and maintains a tight coupling between kernel loading and the DeviceManager. Signed-off-by: Rob Bradford --- vmm/src/device_manager.rs | 5 ++++- vmm/src/vm.rs | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/vmm/src/device_manager.rs b/vmm/src/device_manager.rs index dfb679818..28a8b8fee 100644 --- a/vmm/src/device_manager.rs +++ b/vmm/src/device_manager.rs @@ -834,7 +834,8 @@ pub struct DeviceManager { #[cfg(target_arch = "aarch64")] interrupt_controller: Option>>, - // Things to be added to the commandline (i.e. for virtio-mmio) + // Things to be added to the commandline (e.g. aarch64 early console) + #[cfg(target_arch = "aarch64")] cmdline_additions: Vec, // ACPI GED notification device @@ -1029,6 +1030,7 @@ impl DeviceManager { address_manager: Arc::clone(&address_manager), console: Arc::new(Console::default()), interrupt_controller: None, + #[cfg(target_arch = "aarch64")] cmdline_additions: Vec::new(), ged_notification_device: None, config, @@ -3607,6 +3609,7 @@ impl DeviceManager { &self.console } + #[cfg(target_arch = "aarch64")] pub fn cmdline_additions(&self) -> &[String] { self.cmdline_additions.as_slice() } diff --git a/vmm/src/vm.rs b/vmm/src/vm.rs index 4e8b8b727..0e5f94f2e 100644 --- a/vmm/src/vm.rs +++ b/vmm/src/vm.rs @@ -972,6 +972,8 @@ impl Vm { cmdline .insert_str(self.config.lock().unwrap().cmdline.args.clone()) .map_err(Error::CmdLineInsertStr)?; + + #[cfg(target_arch = "aarch64")] for entry in self.device_manager.lock().unwrap().cmdline_additions() { cmdline.insert_str(entry).map_err(Error::CmdLineInsertStr)?; }