mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-10 13:19:08 +00:00
runtime-rs: move creation of VM path from start_vm() to prepare_vm()
This fixes a flaw pointed out in review of PR #8185. Creation of the directory semantically fits better into VM preparation than VM launch. Signed-off-by: Pavel Mores <pmores@redhat.com>
This commit is contained in:
@@ -46,15 +46,15 @@ impl QemuInner {
|
|||||||
info!(sl!(), "Preparing QEMU VM");
|
info!(sl!(), "Preparing QEMU VM");
|
||||||
self.id = id.to_string();
|
self.id = id.to_string();
|
||||||
|
|
||||||
|
let vm_path = [KATA_PATH, self.id.as_str()].join("/");
|
||||||
|
std::fs::create_dir_all(vm_path)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) async fn start_vm(&mut self, _timeout: i32) -> Result<()> {
|
pub(crate) async fn start_vm(&mut self, _timeout: i32) -> Result<()> {
|
||||||
info!(sl!(), "Starting QEMU VM");
|
info!(sl!(), "Starting QEMU VM");
|
||||||
|
|
||||||
let vm_path = [KATA_PATH, self.id.as_str()].join("/");
|
|
||||||
std::fs::create_dir_all(vm_path)?;
|
|
||||||
|
|
||||||
let mut cmdline = QemuCmdLine::new(&self.id, &self.config)?;
|
let mut cmdline = QemuCmdLine::new(&self.id, &self.config)?;
|
||||||
|
|
||||||
// If there's a Vsock Device in `self.devices` the vhost-vsock file
|
// If there's a Vsock Device in `self.devices` the vhost-vsock file
|
||||||
|
Reference in New Issue
Block a user