[OE-core] [PATCH 1/1] testimage: fix boolean checking for QEMU_USE_KVM
Chen Qi
Qi.Chen at windriver.com
Tue Dec 4 05:04:46 UTC 2018
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
--
1.9.1
More information about the Openembedded-core
mailing list