From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [kvm-unit-tests PATCH v3 3/6] arch-run: reduce return code ambiguity Date: Wed, 2 Mar 2016 18:13:44 +0100 Message-ID: <20160302171343.GB2354@potion.brq.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> <56D6FC58.9010307@redhat.com> <20160302154237.GA2354@potion.brq.redhat.com> <56D70F34.8050507@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: Paolo Bonzini Return-path: Received: from mx1.redhat.com ([209.132.183.28]:51608 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752989AbcCBRNr (ORCPT ); Wed, 2 Mar 2016 12:13:47 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 3EDB132E8A4 for ; Wed, 2 Mar 2016 17:13:47 +0000 (UTC) Content-Disposition: inline In-Reply-To: <56D70F34.8050507@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 2016-03-02 17:05+0100, Paolo Bonzini: > On 02/03/2016 16:42, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: >>> > I'm not sure how you would have something on stderr, except on th= e 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= =2E >>=20 >> QEMU prints some warnings without immediately exiting, e.g. >> warning: host doesn't support requested feature: CPUID.01H:ECX.vmx= [bit 5] >>=20 >> So it's possible that stdout is printed after stderr. Preserving th= e >> visible output could be less confusing in these rare cases. I agree >> with the late printf if you think that the ugly code is not worth it= =2E >=20 > Perhaps we can add an "stderr:" line if $errors is not empty, so that= it > is clear that the order is not maintained. I prefer to print stderr afterwards without any separator. ("stderr:\n" taints stderr and the information provided by it isn't tha= t hard to figure out from the output or code. I think that this line would attract attention, because it is an unexpected element, and therefore waste more time than silently reordering the output. The line might be useful when we merge stdout and stderr into one stream, but that doesn't happen at this point.)