mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: do not start signal thread to resize console if no need
Now cloud hypervisor will start signal thread to catch SIGWINCH signal, cloud hypervisor then will resize the guest console via vconsole. This patch skip starting signal thread when there is no need to resize guest console, such as console is not configured. Signed-off-by: Yong He <alexyonghe@tencent.com>
This commit is contained in:
@@ -1943,6 +1943,11 @@ impl Vm {
|
||||
fn setup_signal_handler(&mut self) -> Result<()> {
|
||||
let console = self.device_manager.lock().unwrap().console().clone();
|
||||
let signals = Signals::new(Vm::HANDLED_SIGNALS);
|
||||
|
||||
if !console.need_resize() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
match signals {
|
||||
Ok(signals) => {
|
||||
self.signals = Some(signals.handle());
|
||||
|
||||
Reference in New Issue
Block a user