public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: kvm@vger.kernel.org
Subject: Re: [kvm-unit-tests PATCH v3 3/3] arm/run: introduce usingkvm var and use it
Date: Wed, 8 Jul 2015 17:37:32 +0200	[thread overview]
Message-ID: <20150708153732.GA3198@hawk.localdomain> (raw)
In-Reply-To: <1436369020-22489-4-git-send-email-alex.bennee@linaro.org>

On Wed, Jul 08, 2015 at 04:23:40PM +0100, Alex Bennée wrote:
> This makes the script a little cleaner by only checking for KVM support
> in one place. If KVM isn't available we can fall back to TCG emulation
> and echo the fact to the screen rather than let QEMU complain.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> 
> ---
> v2
>   - rm redundant M= statement
> v3
>   - make usingkvm use "yes"
>   - merge patches 3/4 into one
> ---
>  arm/run | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/arm/run b/arm/run
> index 6b42a2e..cf6e902 100755
> --- a/arm/run
> +++ b/arm/run
> @@ -8,6 +8,15 @@ fi
>  source config.mak
>  processor="$PROCESSOR"
>  
> +# Default to using KVM if available and on the right ARM host
> +if [ -c /dev/kvm ]; then
> +	if [ "$HOST" = "arm" ] && [ "$ARCH" = "arm" ]; then
> +		usingkvm=yes
> +	elif [ "$HOST" = "aarch64" ]; then
> +		usingkvm=yes
> +	fi
> +fi
> +
>  qemu="${QEMU:-qemu-system-$ARCH_NAME}"
>  qpath=$(which $qemu 2>/dev/null)
>  
> @@ -22,6 +31,12 @@ if ! $qemu -machine '?' 2>&1 | grep 'ARM Virtual Machine' > /dev/null; then
>  fi
>  
>  M='-machine virt'
> +if [ "$usingkvm" = "yes" ]; then
> +	M+=",accel=kvm"
double quotes here

> +else
> +	echo "Running with TCG"
> +	M+=',accel=tcg'
single here

> +fi

but it doesn't matter

>  
>  if ! $qemu $M -device '?' 2>&1 | grep virtconsole > /dev/null; then
>  	echo "$qpath doesn't support virtio-console for chr-testdev. Exiting."
> @@ -34,12 +49,11 @@ if $qemu $M -chardev testdev,id=id -initrd . 2>&1 \
>  	exit 2
>  fi
>  
> -M='-machine virt,accel=kvm:tcg'
>  chr_testdev='-device virtio-serial-device'
>  chr_testdev+=' -device virtconsole,chardev=ctd -chardev testdev,id=ctd'
>  
>  # arm64 must use '-cpu host' with kvm
> -if [ "$(arch)" = "aarch64" ] && [ "$ARCH" = "arm64" ] && [ -c /dev/kvm ]; then
> +if [ "$usingkvm" = "yes" ] && [ "$ARCH" = "arm64" ]; then
>  	processor="host"
>  fi
>  
> -- 
> 2.4.5

Reviewed-by: Andrew Jones <drjones@redhat.com>

Thanks,
drew
> 
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2015-07-08 15:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-08 15:23 [kvm-unit-tests PATCH v3 0/3] A couple of small fixes Alex Bennée
2015-07-08 15:23 ` [kvm-unit-tests PATCH v3 1/3] README: add some CONTRIBUTING notes Alex Bennée
2015-07-08 15:23 ` [kvm-unit-tests PATCH v3 2/3] configure: emit HOST=$host to config.mak Alex Bennée
2015-07-08 15:23 ` [kvm-unit-tests PATCH v3 3/3] arm/run: introduce usingkvm var and use it Alex Bennée
2015-07-08 15:37   ` Andrew Jones [this message]

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=20150708153732.GA3198@hawk.localdomain \
    --to=drjones@redhat.com \
    --cc=alex.bennee@linaro.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox