mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-02 11:35:46 +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>
This commit is contained in:
parent
cf2abd35d0
commit
a749063c8a
@ -1742,7 +1742,7 @@ impl DeviceManager {
|
|||||||
self.config.lock().unwrap().console.file = Some(pty.path.clone());
|
self.config.lock().unwrap().console.file = Some(pty.path.clone());
|
||||||
let file = pty.main.try_clone().unwrap();
|
let file = pty.main.try_clone().unwrap();
|
||||||
self.console_pty = Some(Arc::new(Mutex::new(pty)));
|
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)
|
Endpoint::FilePair(file.try_clone().unwrap(), file)
|
||||||
} else {
|
} else {
|
||||||
let (main, mut sub, path) =
|
let (main, mut sub, path) =
|
||||||
|
Loading…
Reference in New Issue
Block a user