vmm: Allow the DeviceManager to inject extra kernel commandline entries

This is useful for virtio-mmio to be able to provide the commandline
entries for the devices.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2019-09-11 16:22:00 +01:00
parent 3df1680888
commit 6d27ac9dfc
2 changed files with 16 additions and 2 deletions

View File

@@ -752,8 +752,12 @@ impl<'a> Vm<'a> {
}
pub fn load_kernel(&mut self) -> Result<GuestAddress> {
let cmdline_cstring =
CString::new(self.config.cmdline.args.clone()).map_err(|_| Error::CmdLine)?;
let mut cmdline = self.config.cmdline.args.clone();
for entry in self.devices.cmdline_additions() {
cmdline.insert_str(entry).map_err(|_| Error::CmdLine)?;
}
let cmdline_cstring = CString::new(cmdline).map_err(|_| Error::CmdLine)?;
let mem = self.memory.read().unwrap();
let entry_addr = match linux_loader::loader::Elf::load(
mem.deref(),