vmm: Encompass guest payload configuration in PayloadConfig

Introduce a new top level member of VmConfig called PayloadConfig that
(currently) encompasses the kernel, commandline and initramfs for the
guest to use.

In future this can be extended for firmware use. The existing
"--kernel", "--cmdline" and "initramfs" CLI parameters now fill the
PayloadConfig.

Any config supplied which uses the now deprecated config members have
those members mapped to the new version with a warning.

See: #4445

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2022-08-10 11:24:31 +01:00
parent 5810e3bee8
commit cef51a9de0
4 changed files with 146 additions and 108 deletions
+9 -7
View File
@@ -1968,8 +1968,8 @@ const DEVICE_MANAGER_SNAPSHOT_ID: &str = "device-manager";
mod unit_tests {
use super::*;
use config::{
CmdlineConfig, ConsoleConfig, ConsoleOutputMode, CpusConfig, HotplugMethod, KernelConfig,
MemoryConfig, RngConfig, VmConfig,
CmdlineConfig, ConsoleConfig, ConsoleOutputMode, CpusConfig, HotplugMethod, MemoryConfig,
PayloadConfig, RngConfig, VmConfig,
};
fn create_dummy_vmm() -> Vmm {
@@ -2010,13 +2010,15 @@ mod unit_tests {
prefault: false,
zones: None,
},
kernel: Some(KernelConfig {
path: PathBuf::from("/path/to/kernel"),
}),
initramfs: None,
kernel: None,
cmdline: CmdlineConfig {
args: String::from(""),
args: String::default(),
},
initramfs: None,
payload: Some(PayloadConfig {
kernel: Some(PathBuf::from("/path/to/kernel")),
..Default::default()
}),
disks: None,
net: None,
rng: RngConfig {