[OE-core] [PATCH 1/1] testimage: fix boolean checking for QEMU_USE_KVM
Richard Purdie
richard.purdie at linuxfoundation.org
Tue Dec 4 12:22:55 UTC 2018
On Tue, 2018-12-04 at 13:04 +0800, Chen Qi wrote:
> If QEMU_USE_KVM is set to a list of machines, when doing testimage
> for a machine outside the list, we will get the following error.
>
> Exception: ValueError: Invalid boolean value 'intel-corei7-64
> intel-core2-32 qemux86 qemux86-64'
>
> This is because oe.types.boolean raises error if the parameter
> is not values like 'true', 'false', etc.
>
> Fix the boolean checking to avoid the exception.
>
> Signed-off-by: Chen Qi <Qi.Chen at windriver.com>
> ---
> meta/classes/testimage.bbclass | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes/testimage.bbclass
> b/meta/classes/testimage.bbclass
> index 82cbb06..80e457b 100644
> --- a/meta/classes/testimage.bbclass
> +++ b/meta/classes/testimage.bbclass
> @@ -231,7 +231,7 @@ def testimage_main(d):
> qemu_use_kvm = d.getVar("QEMU_USE_KVM")
> if qemu_use_kvm and \
> (d.getVar('MACHINE') in qemu_use_kvm.split() or \
> - oe.types.boolean(qemu_use_kvm) and 'x86' in machine):
> + qemu_use_kvm.lower() in ('yes', 'y', 'true', 't', '1') and
> 'x86' in machine):
> kvm = True
> else:
> kvm = False
Personally, I think we should just drop support for listing the
machines in QEMU_USE_KVM and suggest people use overrides instead?
Cheers,
Richard
More information about the Openembedded-core
mailing list