From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [kvm-unit-tests PATCH v3 3/6] arch-run: reduce return code ambiguity Date: Wed, 2 Mar 2016 15:44:40 +0100 Message-ID: <56D6FC58.9010307@redhat.com> References: <1456772003-27911-1-git-send-email-drjones@redhat.com> <1456772003-27911-4-git-send-email-drjones@redhat.com> <56D609AC.80303@redhat.com> <20160302125659.GA2007@potion.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Andrew Jones , kvm@vger.kernel.org To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Return-path: Received: from mx1.redhat.com ([209.132.183.28]:54592 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753536AbcCBOoo (ORCPT ); Wed, 2 Mar 2016 09:44:44 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id E835C50F46 for ; Wed, 2 Mar 2016 14:44:43 +0000 (UTC) In-Reply-To: <20160302125659.GA2007@potion.brq.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 02/03/2016 13:57, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: > 2016-03-01 22:29+0100, Paolo Bonzini: >> On 29/02/2016 19:53, Andrew Jones wrote: >>> + errors=3D$("${@}" 2>&1 1>&${stdout} | tee >(cat - 1>&2); exit ${P= IPESTATUS[0]}) >> >> Whoa! :) So stdout goes to {stdout} and from there to the real stdo= ut; >> stderr instead is tee'd to stderr and $errors. >=20 > Yeah. :) >=20 >> Is the "tee" and "cat" necessary? Can you just use printf somewhat = like: >=20 > They are, if you want want to improve chances of getting the original > order of stdout and stderr. Getting the original order can't really work if you use separate file descriptions. I'm not sure how you would have something on stderr, except on the very last line? The idea being that 1) the test only writes to stdout 2) QEMU only writes to stderr 3) QEMU exits after writing to stderr. If this is true, the proposed assignment/printf pair works just fine. >>> + temp_file RUNTIME_arch_run <(echo "#!/bin/bash"; cat scripts/arch= -run.bash "$TEST_DIR/run") >> >> Please use a pipe instead of a <(...): >=20 > (Is it for aesthetic reasons?) Yes, nothing more. Also, gzip has "-c", might as well use it. Paolo