mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 13:45:20 +00:00
vmm: Don't assume that resize_pipe is initialised
If the underlying kernel is old PTY resize is disabled and this is
represented by the use of None in the provided Option<File> type. In the
virtio-console PTY path don't blindly unwrap() the value that will be
preserved across a reboot.
Fixes: #3496
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
(cherry picked from commit a749063c8a
)
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
758ef9604a
commit
0f54fb1f5f
@ -1742,7 +1742,7 @@ impl DeviceManager {
|
||||
self.config.lock().unwrap().console.file = Some(pty.path.clone());
|
||||
let file = pty.main.try_clone().unwrap();
|
||||
self.console_pty = Some(Arc::new(Mutex::new(pty)));
|
||||
self.console_resize_pipe = Some(Arc::new(resize_pipe.unwrap()));
|
||||
self.console_resize_pipe = resize_pipe.map(Arc::new);
|
||||
Endpoint::FilePair(file.try_clone().unwrap(), file)
|
||||
} else {
|
||||
let (main, mut sub, path) =
|
||||
|
Loading…
Reference in New Issue
Block a user