vmm: When receiving a migration store the config

The configuration is stored separately to the Vm in the VMM. The failure
to store the config was preventing the VM from shutting down correctly
as Vmm::vm_delete() checks for the presence of the config.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2020-11-24 17:26:02 +00:00 committed by Samuel Ortiz
parent 9fc2613b41
commit b5b97f7b05

View File

@ -673,8 +673,9 @@ impl Vmm {
let reset_evt = self.reset_evt.try_clone().map_err(|e| {
MigratableError::MigrateReceive(anyhow!("Error cloning reset EventFd: {}", e))
})?;
self.vm_config = Some(Arc::new(Mutex::new(config)));
let vm = Vm::new_from_migration(
Arc::new(Mutex::new(config)),
self.vm_config.clone().unwrap(),
exit_evt,
reset_evt,
&self.seccomp_action,
@ -848,6 +849,7 @@ impl Vmm {
Command::Abandon => {
info!("Abandon Command Received");
self.vm = None;
self.vm_config = None;
Response::ok().write_to(&mut socket).ok();
break;
}