oeqa: Fix for QEMU_USE_KVM

Fixed:
MACHINE = "qemux86"
QEMU_USE_KVM = "qemux86"
IMAGE_CLASSES += "testimage"

$ oe-selftest -r runqemu.RunqemuTests.test_boot_rootfs

[snip]
  File "/buildarea1/lyang1/poky/meta/lib/oe/types.py", line 122, in boolean
    raise ValueError("Invalid boolean value '%s'" % value)
ValueError: Invalid boolean value 'qemux86'

Now QEMU_USE_KVM can only be boolean, can not contain MACHINE any more, kvm
will be enabled if target_arch == build_arch or both of them are x86 archs.

(From OE-Core rev: 7c1a8a624cad8d967635c6cb5f99cf655bde3d44)

(From OE-Core rev: 2c12e1d9c262fb7e5fe02ae2d092789d6536413f)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Robert Yang
2019-01-04 15:15:43 +08:00
committed by Richard Purdie
parent e82e4d2cb0
commit 6b6b442f3e
3 changed files with 26 additions and 14 deletions

View File

@@ -248,13 +248,7 @@ def testimage_main(d):
boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT"))
# Get use_kvm
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):
kvm = True
else:
kvm = False
kvm = oe.types.qemu_use_kvm(d.getVar('QEMU_USE_KVM'), d.getVar('TARGET_ARCH'))
# TODO: We use the current implementatin of qemu runner because of
# time constrains, qemu runner really needs a refactor too.