mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user