mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Only send stdin input to serial/console if it can handle it
Do not send the contents of stdin to the serial or console device if they're not in tty mode. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
committed by
Sebastien Boeuf
parent
aa44726658
commit
f910476dd7
@@ -352,6 +352,15 @@ pub enum ConsoleOutputMode {
|
||||
File,
|
||||
}
|
||||
|
||||
impl ConsoleOutputMode {
|
||||
pub fn input_enabled(&self) -> bool {
|
||||
match self {
|
||||
ConsoleOutputMode::Tty => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ConsoleConfig<'a> {
|
||||
pub file: Option<&'a Path>,
|
||||
pub mode: ConsoleOutputMode,
|
||||
|
||||
Reference in New Issue
Block a user