From a0ae3ad1df3df209006bd4cddb3858e3c994a706 Mon Sep 17 00:00:00 2001 From: BharatNarasimman Date: Mon, 23 Sep 2024 22:12:07 +0000 Subject: [PATCH] vmm: Pass the newly created console resizer pipe during vm reboot For a VM with virt-console enabled, when a reboot is requested, the console devices are closed during the shutdown path. As part of this the sigwinch listener process and the console resizer pipe are closed. For the new incarnation of the VM, fresh set of console devices are setup and a new console resizer pipe is created. The new VM should be setup to use the newly created console devices including the console resizer pipe. Reading from the older console resizer pipe results in unexpected eof error and terminates the cloud hypervisor process. Signed-off-by: BharatNarasimman --- vmm/src/lib.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/vmm/src/lib.rs b/vmm/src/lib.rs index 922121655..424147999 100644 --- a/vmm/src/lib.rs +++ b/vmm/src/lib.rs @@ -1490,11 +1490,10 @@ impl RequestHandler for Vmm { event!("vm", "rebooting"); // First we stop the current VM - let (config, console_resize_pipe) = if let Some(mut vm) = self.vm.take() { + let config = if let Some(mut vm) = self.vm.take() { let config = vm.get_config(); - let console_resize_pipe = vm.console_resize_pipe(); vm.shutdown()?; - (config, console_resize_pipe) + config } else { return Err(VmError::VmNotCreated); }; @@ -1536,7 +1535,7 @@ impl RequestHandler for Vmm { self.hypervisor.clone(), activate_evt, self.console_info.clone(), - console_resize_pipe, + self.console_resize_pipe.as_ref().map(Arc::clone), Arc::clone(&self.original_termios_opt), None, None,