From: =?UTF-8?B?THVrw6HFoSBEb2t0b3I=?= Subject: Re: [PATCH] scripts/runtime: Adjust the premature_failure check Date: Tue, 31 May 2016 20:13:54 +0200 Message-ID: <4e9c147c-dfbf-4985-1869-3f3712bfa579@redhat.com> References: <1464692057-19348-1-git-send-email-ldoktor@redhat.com> <1464692057-19348-2-git-send-email-ldoktor@redhat.com> <20160531153747.GB30930@potion> <20160531155617.GA11111@potion> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7xgroDUDRqRl6sw19i1g6cWJUla61cDQ0" Cc: kvm@vger.kernel.org, drjones@redhat.com, pbonzini@redhat.com, lvivier@redhat.com To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Return-path: Received: from mx1.redhat.com ([209.132.183.28]:36186 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755438AbcEaSN6 (ORCPT ); Tue, 31 May 2016 14:13:58 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4CE726445D for ; Tue, 31 May 2016 18:13:57 +0000 (UTC) In-Reply-To: <20160531155617.GA11111@potion> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --7xgroDUDRqRl6sw19i1g6cWJUla61cDQ0 Content-Type: multipart/mixed; boundary="2Wj5PxR9erL2IdBNEIgABwANWflBkIJIm" From: =?UTF-8?B?THVrw6HFoSBEb2t0b3I=?= To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Cc: kvm@vger.kernel.org, drjones@redhat.com, pbonzini@redhat.com, lvivier@redhat.com Message-ID: <4e9c147c-dfbf-4985-1869-3f3712bfa579@redhat.com> Subject: Re: [PATCH] scripts/runtime: Adjust the premature_failure check References: <1464692057-19348-1-git-send-email-ldoktor@redhat.com> <1464692057-19348-2-git-send-email-ldoktor@redhat.com> <20160531153747.GB30930@potion> <20160531155617.GA11111@potion> In-Reply-To: <20160531155617.GA11111@potion> --2Wj5PxR9erL2IdBNEIgABwANWflBkIJIm Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Dne 31.5.2016 v 17:56 Radim Kr=C4=8Dm=C3=A1=C5=99 napsal(a): > 2016-05-31 17:37+0200, Radim Kr=C4=8Dm=C3=A1=C5=99: >> 2016-05-31 12:54+0200, Luk=C3=A1=C5=A1 Doktor: >>> The premature_failure check fails on qemu-system-ppc64 as it uses >>> different message. This patch modifies the condition so it works >>> (hopefully) for all archs. >>> --- >>> diff --git a/scripts/runtime.bash b/scripts/runtime.bash >>> - echo "$last_line" | grep -qi "could not load kernel" && >>> + echo "$last_line" | grep "_NO_FILE_4Uhere_" | grep -qi "no such = file" && >> >> PPC uses "Could not open '_NO_FILE_4Uhere_': No such file [...]". >> The problem is that "No such file [...]" might be localized, so what >> about >> grep -qi "could not \(load kernel\|open\) '_NO_FILE_4Uhere_'" >> ? > > My tested local repo has a different line there: > (no idea how the posted version came around ...) > > echo "$last_line" | grep -qi "_NO_FILE_4Uhere_" && Oups, I sent a wrong version. I didn't use the `last_line`, but full outp= ut to check for the result to be more lenient: ``` diff --git a/scripts/runtime.bash b/scripts/runtime.bash index 886814b..96c82c6 100644 --- a/scripts/runtime.bash +++ b/scripts/runtime.bash @@ -15,9 +15,8 @@ extract_summary() premature_failure() { local log=3D"$(eval $(get_cmdline _NO_FILE_4Uhere_) 2>&1)" - local last_line=3D$(tail -1 <<< "$log") =20 - echo "$last_line" | grep "_NO_FILE_4Uhere_" | grep -qi "no such file= " && + echo "$log" | grep "_NO_FILE_4Uhere_" | grep -qi "no such file" && return 1 =20 RUNTIME_log_stderr <<< "$log" ``` Which works for me on ppc64 and x86_64. Anyway it fails on aarch64 as ind= eed the message is localized. I'm wondering how strict this check needs t= o be. I'd be fine with checking the exit_code + `grep -q "_NO_FILE_4Uhere= _"` anywhere in the output. Alternatively how about stronger version could check the last line in thi= s way `echo "$last_line" | grep "_NO_FILE_4Uhere_" | grep -q -e "could no= t load kernel" -e "error loading" which works on my qemu-system-{x86_64,a= arch64,ppc64}. Any preferences? Luk=C3=A1=C5=A1 > > so we might be fine with it too, but I like the context check. > --2Wj5PxR9erL2IdBNEIgABwANWflBkIJIm-- --7xgroDUDRqRl6sw19i1g6cWJUla61cDQ0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJXTdRiAAoJECazYuR/zyLBE8kIANoNg7TDqv0RBtBmzJXkGFOE RvPt7qZ5r52Z0pHDFisC4fvnlAdhoOrGXCNcAD+doqYTAsB7ZjeqFekKU4X0Sjc4 2Z2YrqlYJsYipB+LTXKJg3OipQLxrF6g4QzuhcULo9StP0sZZH6+QgUgl79/K+ab 0Nf38JsHwMDkx0BQoxXA7nG6gjcEz542FlUpyeQzMAFgT+JaERGy2N6qqobhszpW IZXDGcsTQt347O+FEYw4AA7JHDx5Ftbhlo1+oWPsRNfPfD6cu3T+aLQZL353aIZ8 Fcm5yNnLaOoS6NzQJmMWmn2X0I651uamZuOXpTAYGVKBrHUexWFMw3/S3IOoo64= =vdtw -----END PGP SIGNATURE----- --7xgroDUDRqRl6sw19i1g6cWJUla61cDQ0--