kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: kvm@vger.kernel.org
Cc: Paolo Bonzini <pbonzini@redhat.com>, Andrew Jones <drjones@redhat.com>
Subject: [kvm-unit-tests PATCH v2] scripts/arch-run: print stderr immediately
Date: Tue, 15 Nov 2016 15:45:32 +0100	[thread overview]
Message-ID: <20161115144532.10119-1-rkrcmar@redhat.com> (raw)

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

Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
---
 v2: use /dev/... files instead of &${file descriptor numbers} [Paolo]
---
 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..0a1ae95396f9 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 /dev/stderr) > /dev/fd/$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.2


             reply	other threads:[~2016-11-15 14:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-15 14:45 Radim Krčmář [this message]
2016-11-15 14:47 ` [kvm-unit-tests PATCH v2] scripts/arch-run: print stderr immediately Paolo Bonzini
2016-11-15 14:51   ` Radim Krčmář

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161115144532.10119-1-rkrcmar@redhat.com \
    --to=rkrcmar@redhat.com \
    --cc=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).