From mboxrd@z Thu Jan 1 00:00:00 1970 From: Balamuruhan S Subject: Re: [kvm-unit-tests PATCH 1/4] scripts/arch-run: function to search qemu binary Date: Fri, 21 Apr 2017 12:16:15 +0530 Message-ID: <20170421064615.GA6244@dhcp-9-199-64-251.in.ibm.com> References: <1492629251-23267-1-git-send-email-bala24@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: drjones@redhat.com Return-path: Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:33022 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1035856AbdDUGrW (ORCPT ); Fri, 21 Apr 2017 02:47:22 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v3L6hgrt000494 for ; Fri, 21 Apr 2017 02:47:21 -0400 Received: from e23smtp08.au.ibm.com (e23smtp08.au.ibm.com [202.81.31.141]) by mx0b-001b2d01.pphosted.com with ESMTP id 29xwu7d3a3-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 21 Apr 2017 02:47:20 -0400 Received: from localhost by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 21 Apr 2017 16:47:17 +1000 Received: from d23av05.au.ibm.com (d23av05.au.ibm.com [9.190.234.119]) by d23relay07.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v3L6l6F45046548 for ; Fri, 21 Apr 2017 16:47:14 +1000 Received: from d23av05.au.ibm.com (localhost [127.0.0.1]) by d23av05.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v3L6kgdu024910 for ; Fri, 21 Apr 2017 16:46:42 +1000 Content-Disposition: inline In-Reply-To: <1492629251-23267-1-git-send-email-bala24@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: Hi drew, I have added the function in scripts/arch-run as per your suggestion. I have tested the patches in x86 and PowerPC but for arm I don't have the system to test. Thanks, Bala On Thu, Apr 20, 2017 at 12:44:11AM +0530, Balamuruhan S wrote: > qemu_binary function to seach qemu binary similar to x86/run does > so that it can be reused for all arches > > Signed-off-by: Balamuruhan S > --- > scripts/arch-run.bash | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash > index 94c50f3..404a4c0 100644 > --- a/scripts/arch-run.bash > +++ b/scripts/arch-run.bash > @@ -133,3 +133,25 @@ migration_cmd () > echo "run_migration" > fi > } > + > +# qemu binary search function for all arches > +qemu_binary () > +{ > + PATH=$PATH:/usr/libexec > + qemubinarysearch="${QEMU:-qemu-system-$ARCH_NAME qemu-kvm}" > + for qemucmd in ${qemubinarysearch} > + do > + unset QEMUFOUND > + unset qemu > + if ! [ -z "${QEMUFOUND=$(${qemucmd} --help 2>/dev/null | grep "QEMU")}" ] > + then > + qemu="${qemucmd}" > + break > + fi > + done > + > + if [ -z "${QEMUFOUND}" ]; then > + echo "A QEMU binary was not found, You can set a custom location by using the QEMU= environment variable" > + exit 2 > + fi > +} > -- > 2.7.4 >