* [kvm-unit-tests PATCH v2] scripts/arch-run: print stderr immediately
@ 2016-11-15 14:45 Radim Krčmář
2016-11-15 14:47 ` Paolo Bonzini
0 siblings, 1 reply; 3+ messages in thread
From: Radim Krčmář @ 2016-11-15 14:45 UTC (permalink / raw)
To: kvm; +Cc: Paolo Bonzini, Andrew Jones
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [kvm-unit-tests PATCH v2] scripts/arch-run: print stderr immediately
2016-11-15 14:45 [kvm-unit-tests PATCH v2] scripts/arch-run: print stderr immediately Radim Krčmář
@ 2016-11-15 14:47 ` Paolo Bonzini
2016-11-15 14:51 ` Radim Krčmář
0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2016-11-15 14:47 UTC (permalink / raw)
To: Radim Krčmář, kvm; +Cc: Andrew Jones
On 15/11/2016 15:45, Radim Krčmář wrote:
> # stdout to {stdout}, stderr to $errors
"stderr to $errors and stderr"
Please make the change and commit it, no need for v3!
Thanks,
Paolo
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [kvm-unit-tests PATCH v2] scripts/arch-run: print stderr immediately
2016-11-15 14:47 ` Paolo Bonzini
@ 2016-11-15 14:51 ` Radim Krčmář
0 siblings, 0 replies; 3+ messages in thread
From: Radim Krčmář @ 2016-11-15 14:51 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: kvm, Andrew Jones
2016-11-15 15:47+0100, Paolo Bonzini:
> On 15/11/2016 15:45, Radim Krčmář wrote:
>> # stdout to {stdout}, stderr to $errors
>
> "stderr to $errors and stderr"
>
> Please make the change and commit it, no need for v3!
Bloody comments, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-11-15 14:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-15 14:45 [kvm-unit-tests PATCH v2] scripts/arch-run: print stderr immediately Radim Krčmář
2016-11-15 14:47 ` Paolo Bonzini
2016-11-15 14:51 ` Radim Krčmář
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).