aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2017-04-13 18:26:31 +0100
committerWill Deacon <will.deacon@arm.com>2017-04-24 11:08:54 +0100
commitfc189e9c6833c64d6a29e9196c689f41fca3b241 (patch)
treec853f34d2f44bd937df9503041e0cbb5e997aab9
parent3fea89a924511f9f8fe05a892098fad77c1eca0d (diff)
downloadkvmtool-fc189e9c6833c64d6a29e9196c689f41fca3b241.tar.gz
kvmtool: Switch serial input to raw mode
As I was trying to install a new VM using the Debian installer, I noticed that the return key would work just fine in a shell, but wouldn't do anything in the menu. Pretty annoying. Further investigation showed that the terminal was left in cooked mode, converting CR to LF, and thus giving the VM the wrong information. Clearing the ICRNL flag in the input flag set fixes the issue. Suggested-by: Dave martin <dave.martin@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r--term.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/term.c b/term.c
index 58f66a0c..b8a70fe2 100644
--- a/term.c
+++ b/term.c
@@ -190,6 +190,7 @@ static int term_init(struct kvm *kvm)
term = orig_term;
+ term.c_iflag &= ~(ICRNL);
term.c_lflag &= ~(ICANON | ECHO | ISIG);
tcsetattr(STDIN_FILENO, TCSANOW, &term);