Re: [kvm-unit-tests RFC 1/2] scripts: Check kvm availability by asking qemu

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>
>> ---
>>  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
> 




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux