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:
Rob Bradford
2019-08-09 11:48:03 +01:00
committed by Sebastien Boeuf
parent aa44726658
commit f910476dd7
2 changed files with 15 additions and 2 deletions
+9
View File
@@ -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,