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 <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2022-04-28 15:21:14 +01:00
parent da33eb5e8c
commit f1276c58d2
2 changed files with 6 additions and 1 deletions

View File

@ -834,7 +834,8 @@ pub struct DeviceManager {
#[cfg(target_arch = "aarch64")]
interrupt_controller: Option<Arc<Mutex<gic::Gic>>>,
// 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<String>,
// 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()
}

View File

@ -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)?;
}