[kvm-unit-tests PATCH] scripts/arch-run: print stderr immediately

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Not doing so hid stderr output when the test was stuck and subsequently
killed with ^C.

Signed-off-by: Radim Krčmář <rkrcmar@xxxxxxxxxx>
---
 scripts/arch-run.bash | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
index 8e75c6ed6e17..326f59484e2b 100644
--- a/scripts/arch-run.bash
+++ b/scripts/arch-run.bash
@@ -30,12 +30,11 @@ run_qemu ()
 
 	# stdout to {stdout}, stderr to $errors
 	exec {stdout}>&1
-	errors=$("${@}" 2>&1 1>&${stdout})
+	errors=$("${@}" 2> >(tee >(cat) >&2) 1>&${stdout})
 	ret=$?
 	exec {stdout}>&-
 
 	if [ "$errors" ]; then
-		printf "%s\n" "$errors" >&2
 		sig=$(grep 'terminating on signal' <<<"$errors")
 		if [ "$sig" ]; then
 			sig=$(sed 's/.*terminating on signal \([0-9][0-9]*\).*/\1/' <<<"$sig")
-- 
2.10.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux