public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Janosch Frank <frankja@linux.ibm.com>
To: Andrew Jones <drjones@redhat.com>
Cc: kvm@vger.kernel.org, lvivier@redhat.com, thuth@redhat.com,
	david@redhat.com, pbonzini@redhat.com, cohuck@redhat.com
Subject: Re: [kvm-unit-tests RFC 1/2] scripts: Check kvm availability by asking qemu
Date: Thu, 18 Mar 2021 16:39:35 +0100	[thread overview]
Message-ID: <b6cf5a10-bb8d-799e-16cf-92c225b39fb8@linux.ibm.com> (raw)
In-Reply-To: <20210318153114.ohppqscosrijj7bs@kamzik.brq.redhat.com>

On 3/18/21 4:31 PM, Andrew Jones wrote:
> On Thu, Mar 18, 2021 at 12:44:59PM +0000, Janosch Frank wrote:
>> The existence of the /dev/kvm character device doesn't imply that the
>> kvm module is part of the kernel or that it's always magically loaded
>> when needed.
>>
>> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
>> ---
>>  arm/run               | 4 ++--
>>  powerpc/run           | 4 ++--
>>  s390x/run             | 4 ++--
>>  scripts/arch-run.bash | 7 +++++--
>>  x86/run               | 4 ++--
>>  5 files changed, 13 insertions(+), 10 deletions(-)
>>
>> diff --git a/arm/run b/arm/run
>> index a390ca5a..ca2d44e0 100755
>> --- a/arm/run
>> +++ b/arm/run
>> @@ -10,10 +10,10 @@ if [ -z "$STANDALONE" ]; then
>>  fi
>>  processor="$PROCESSOR"
>>  
>> -ACCEL=$(get_qemu_accelerator) ||
>> +qemu=$(search_qemu_binary) ||
>>  	exit $?
>>  
>> -qemu=$(search_qemu_binary) ||
>> +ACCEL=$(get_qemu_accelerator) ||
>>  	exit $?
> 
> How about renaming search_qemu_binary() to set_qemu_accelerator(), which
> would also ensure QEMU is set (if it doesn't error out on failure) and
> then call that from get_qemu_accelerator()? That way we don't need to
> worry about this order of calls nor this lowercase 'qemu' variable being
> set. Also, we can rename get_qemu_accelerator() to set_qemu_accelerator()
> and ensure it sets ACCEL.

Sure, I was already considering that.

The fact that qemu and ACCEL are basically global and accel is not the
same as ACCEL makes all of this harder to understand than it should be.

> 
> Thanks,
> drew
> 


  reply	other threads:[~2021-03-18 15:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-18 12:44 [kvm-unit-tests RFC 0/2] scripts: Fix accel handling Janosch Frank
2021-03-18 12:44 ` [kvm-unit-tests RFC 1/2] scripts: Check kvm availability by asking qemu Janosch Frank
2021-03-18 14:18   ` Andrew Jones
2021-03-18 15:31   ` Andrew Jones
2021-03-18 15:39     ` Janosch Frank [this message]
2021-03-24 14:11     ` Janosch Frank
2021-03-18 12:45 ` [kvm-unit-tests RFC 2/2] scripts: Set ACCEL in run_tests.sh if empty Janosch Frank
2021-03-18 15:42   ` Andrew Jones

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=b6cf5a10-bb8d-799e-16cf-92c225b39fb8@linux.ibm.com \
    --to=frankja@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=thuth@redhat.com \
    /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