From: Paolo Bonzini Subject: Re: [PATCH kvm-unit-tests] arch-run: more qemu binary search cleanup Date: Thu, 27 Apr 2017 17:52:19 +0200 Message-ID: References: <20170424092618.21950-1-drjones@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: bala24@linux.vnet.ibm.com To: Andrew Jones , kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:47144 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031688AbdD0PwX (ORCPT ); Thu, 27 Apr 2017 11:52:23 -0400 In-Reply-To: <20170424092618.21950-1-drjones@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 24/04/2017 11:26, Andrew Jones wrote: > We use tabs in scripts/arch-run.bash, which the import of the > function forgot to convert to. Also, while touching all lines > to add the tabs, apply some more cleanups and simplifications. > > Signed-off-by: Andrew Jones Queued, thanks. Paolo > --- > scripts/arch-run.bash | 39 ++++++++++++++++++--------------------- > 1 file changed, 18 insertions(+), 21 deletions(-) > > diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash > index d526d98bcc40..5c10828e30f9 100644 > --- a/scripts/arch-run.bash > +++ b/scripts/arch-run.bash > @@ -134,27 +134,24 @@ migration_cmd () > fi > } > > -# qemu binary search function for all arches > search_qemu_binary () > { > - local save_path=$PATH > - local qemucmd QEMUFOUND qemu > - export PATH=$PATH:/usr/libexec > - for qemucmd in ${QEMU:-qemu-system-$ARCH_NAME qemu-kvm} > - 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 > - which $qemu > - export PATH=$save_path > + local save_path=$PATH > + local qemucmd qemu > + > + export PATH=$PATH:/usr/libexec > + for qemucmd in ${QEMU:-qemu-system-$ARCH_NAME qemu-kvm}; do > + if $qemucmd --help 2>/dev/null | grep -q 'QEMU'; then > + qemu="$qemucmd" > + break > + fi > + done > + > + if [ -z "$qemu" ]; then > + echo "A QEMU binary was not found." > + echo "You can set a custom location by using the QEMU= environment variable." > + exit 2 > + fi > + command -v $qemu > + export PATH=$save_path > } >