From eb8c9d38ff5ccf188523a90ff3bc8d77a788979e Mon Sep 17 00:00:00 2001 From: Pavel Mores Date: Tue, 15 Nov 2022 19:30:02 +0100 Subject: [PATCH] runtime-rs: add launch of a simple qemu process to start_vm() The point here is just to get a simplest Kata VM running. Signed-off-by: Pavel Mores --- .../crates/hypervisor/src/qemu/inner.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/runtime-rs/crates/hypervisor/src/qemu/inner.rs b/src/runtime-rs/crates/hypervisor/src/qemu/inner.rs index a290855136..d985ba724a 100644 --- a/src/runtime-rs/crates/hypervisor/src/qemu/inner.rs +++ b/src/runtime-rs/crates/hypervisor/src/qemu/inner.rs @@ -33,6 +33,23 @@ impl QemuInner { pub(crate) async fn start_vm(&mut self, _timeout: i32) -> Result<()> { info!(sl!(), "Starting QEMU VM"); + + let mut command = std::process::Command::new(&self.config.path); + + command + .arg("-kernel") + .arg(&self.config.boot_info.kernel) + .arg("-m") + .arg(format!("{}M", &self.config.memory_info.default_memory)) + .arg("-initrd") + .arg(&self.config.boot_info.initrd) + .arg("-vga") + .arg("none") + .arg("-nodefaults") + .arg("-nographic"); + + command.spawn()?; + Ok(()) }