From c3fcddf830571162a36a2acbe039e2446559eb9f Mon Sep 17 00:00:00 2001 From: Praveen K Paladugu Date: Tue, 28 May 2024 13:55:42 -0500 Subject: [PATCH] vmm: Fix console dev handling in live migration Console devices are created after vm_config is received and the created devices are passed Vm during vm_receive_state. Signed-off-by: Praveen K Paladugu --- vmm/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vmm/src/lib.rs b/vmm/src/lib.rs index c432e9576..362188e90 100644 --- a/vmm/src/lib.rs +++ b/vmm/src/lib.rs @@ -720,6 +720,9 @@ impl Vmm { let config = vm_migration_config.vm_config.clone(); self.vm_config = Some(vm_migration_config.vm_config); + self.console_info = Some(pre_create_console_devices(self).map_err(|e| { + MigratableError::MigrateReceive(anyhow!("Error creating console devices: {:?}", e)) + })?); let vm = Vm::create_hypervisor_vm( &self.hypervisor, @@ -809,7 +812,7 @@ impl Vmm { self.hypervisor.clone(), activate_evt, timestamp, - None, + self.console_info.clone(), None, Arc::clone(&self.original_termios_opt), Some(snapshot),