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

@@ -277,6 +277,9 @@ pub struct DeviceManager {
// mmap()ed region to unmap on drop
mmap_regions: Vec<(*mut libc::c_void, usize)>,
// Things to be added to the commandline (i.e. for virtio-mmio)
cmdline_additions: Vec<String>,
}
impl DeviceManager {
@@ -392,6 +395,8 @@ impl DeviceManager {
&mut mmap_regions,
)?);
let mut cmdline_additions = Vec::new();
let pci_root = PciRoot::new(None);
let mut pci = PciConfigIo::new(pci_root);
@@ -421,6 +426,7 @@ impl DeviceManager {
ioapic,
pci,
mmap_regions,
cmdline_additions,
};
dm.register_devices()?;
@@ -963,6 +969,10 @@ impl DeviceManager {
pub fn console(&self) -> &Arc<Console> {
&self.console
}
pub fn cmdline_additions(&self) -> &[String] {
self.cmdline_additions.as_slice()
}
}
impl Drop for DeviceManager {