All of lore.kernel.org
 help / color / mirror / Atom feed
From: Balamuruhan S <bala24@linux.vnet.ibm.com>
To: drjones@redhat.com
Cc: kvm@vger.kernel.org
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	[thread overview]
Message-ID: <20170421064615.GA6244@dhcp-9-199-64-251.in.ibm.com> (raw)
In-Reply-To: <1492629251-23267-1-git-send-email-bala24@linux.vnet.ibm.com>

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 <bala24@linux.vnet.ibm.com>
> ---
>  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=<path> environment variable"
> +        exit 2
> +    fi
> +}
> -- 
> 2.7.4
> 

  reply	other threads:[~2017-04-21  6:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-19 19:14 [kvm-unit-tests PATCH 1/4] scripts/arch-run: function to search qemu binary Balamuruhan S
2017-04-21  6:46 ` Balamuruhan S [this message]
2017-04-21 11:07 ` Paolo Bonzini
2017-04-21 12:50   ` Balamuruhan S

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170421064615.GA6244@dhcp-9-199-64-251.in.ibm.com \
    --to=bala24@linux.vnet.ibm.com \
    --cc=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.