From patchwork Tue May 31 18:13:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?THVrw6HFoSBEb2t0b3I=?= X-Patchwork-Id: 9145405 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6C05060752 for ; Tue, 31 May 2016 18:14:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 614C11FF45 for ; Tue, 31 May 2016 18:14:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 53F29280B2; Tue, 31 May 2016 18:14:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_TVD_MIME_EPI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F2C401FF45 for ; Tue, 31 May 2016 18:14:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755921AbcEaSN7 (ORCPT ); Tue, 31 May 2016 14:13:59 -0400 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) Received: from [10.36.6.195] (vpn1-6-195.ams2.redhat.com [10.36.6.195]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4VIDsZd003520; Tue, 31 May 2016 14:13:55 -0400 Subject: Re: [PATCH] scripts/runtime: Adjust the premature_failure check To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= 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> Cc: kvm@vger.kernel.org, drjones@redhat.com, pbonzini@redhat.com, lvivier@redhat.com From: =?UTF-8?B?THVrw6HFoSBEb2t0b3I=?= Message-ID: <4e9c147c-dfbf-4985-1869-3f3712bfa579@redhat.com> Date: Tue, 31 May 2016 20:13:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160531155617.GA11111@potion> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 31 May 2016 18:13:57 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Dne 31.5.2016 v 17:56 Radim Krčmář napsal(a): > 2016-05-31 17:37+0200, Radim Krčmář: >> 2016-05-31 12:54+0200, Lukáš 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 output to check for the result to be more lenient: ``` ``` Which works for me on ppc64 and x86_64. Anyway it fails on aarch64 as indeed the message is localized. I'm wondering how strict this check needs to 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 this way `echo "$last_line" | grep "_NO_FILE_4Uhere_" | grep -q -e "could not load kernel" -e "error loading" which works on my qemu-system-{x86_64,aarch64,ppc64}. Any preferences? Lukáš > > so we might be fine with it too, but I like the context check. > 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="$(eval $(get_cmdline _NO_FILE_4Uhere_) 2>&1)" - local last_line=$(tail -1 <<< "$log") - 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 RUNTIME_log_stderr <<< "$log"