Skip to contentSkip to conversation

arch-run: fix terminal issues without stty

PATCH Applied Andrew Jones 2 participants 2 messages Jan 11, 2017 – Jan 12, 2017 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arch-run: fix terminal issues without stty

This patch reverts the stty parts of 8727c886 "runtime: better handling of QEMU aborts", as we can more robustly fix the same issue by simply redirecting /dev/null into qemu's stdin. The obvious side effect of this is that serial input will no longer be wired up to the tty (or any other input file descriptor), but unit tests do not, and should not, be reading from the serial port anyway.

---
 scripts/arch-run.bash | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
scripts/arch-run.bash +2 -4
index 92fac8cf5f96..1610f3b2e6a6 100644
@@ -26,15 +26,13 @@
 ##############################################################################
 run_qemu ()
 {
-	local stdout errors ret sig tty
+	local stdout errors ret sig
 
 	# stdout to {stdout}, stderr to $errors and stderr
-	tty=$(stty -g)
 	exec {stdout}>&1
-	errors=$("${@}" 2> >(tee /dev/stderr) > /dev/fd/$stdout)
+	errors=$("${@}" </dev/null 2> >(tee /dev/stderr) > /dev/fd/$stdout)
 	ret=$?
 	exec {stdout}>&-
-	stty "$tty"
 
 	[ $ret -eq 134 ] && echo "QEMU Aborted" >&2
 
Signature · 1 line
2.9.3
maintainer Applied
#1 lore raw
Quoted 26 lines · Andrew Jones

This patch reverts the stty parts of 8727c886 "runtime: better handling of QEMU aborts", as we can more robustly fix the same issue by simply redirecting /dev/null into qemu's stdin. The obvious side effect of this is that serial input will no longer be wired up to the tty (or any other input file descriptor), but unit tests do not, and should not, be reading from the serial port anyway.

---
 scripts/arch-run.bash | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
scripts/arch-run.bash +1 -1
index 92fac8cf5f96..1610f3b2e6a6 100644
@@ -26,15 +26,13 @@
 ##############################################################################
 run_qemu ()
 {
-	local stdout errors ret sig tty
+	local stdout errors ret sig
 
 	# stdout to {stdout}, stderr to $errors and stderr

scripts/arch-run.bash line 38

Quoted 10 lines
scripts/arch-run.bash +1 -3
-	tty=$(stty -g)
 	exec {stdout}>&1
-	errors=$("${@}" 2> >(tee /dev/stderr) > /dev/fd/$stdout)
+	errors=$("${@}" </dev/null 2> >(tee /dev/stderr) > /dev/fd/$stdout)
 	ret=$?
 	exec {stdout}>&-
-	stty "$tty"
 
 	[ $ret -eq 134 ] && echo "QEMU Aborted" >&2
 

Queued, thanks.