]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa: QEMU_USE_KVM can list machines
authorPatrick Ohly <patrick.ohly@intel.com>
Mon, 27 Mar 2017 13:03:23 +0000 (15:03 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 28 Mar 2017 07:41:08 +0000 (08:41 +0100)
Previously, QEMU_USE_KVM=True enabled the use of kvm only when "x86"
was in the MACHINE name. That is too limiting, because for example
intel-corei7-64 can also use kvm but it wasn't possible to enable that
without changing OE-core.

That traditional usage is still supported. In addition, QEMU_USE_KVM
can be set to a list of space-separated MACHINE names for which kvm is
to be enabled.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/testimage.bbclass
meta/lib/oeqa/targetcontrol.py

index bfe57144543428c31c1e4d6878780a455037bf1e..a259423c22b4cc4472e4af6080d3e79c6531edd3 100644 (file)
@@ -210,7 +210,9 @@ def testimage_main(d):
 
     # Get use_kvm
     qemu_use_kvm = d.getVar("QEMU_USE_KVM")
-    if qemu_use_kvm and qemu_use_kvm == 'True' and 'x86' in machine:
+    if qemu_use_kvm and \
+       (qemu_use_kvm == 'True' and 'x86' in machine or \
+        d.getVar('MACHINE') in qemu_use_kvm.split()):
         kvm = True
     else:
         kvm = False
index 40a2589cc95de55b12170fe92dc7964907dc4118..c3aeb221dd6fbc21a2bcc7dea94495b974fe6c97 100644 (file)
@@ -131,9 +131,10 @@ class QemuTarget(BaseTarget):
         dump_target_cmds = d.getVar("testimage_dump_target")
         dump_host_cmds = d.getVar("testimage_dump_host")
         dump_dir = d.getVar("TESTIMAGE_DUMP_DIR")
-        if d.getVar("QEMU_USE_KVM", False) is not None \
-           and d.getVar("QEMU_USE_KVM", False) == "True" \
-           and "x86" in d.getVar("MACHINE"):
+        qemu_use_kvm = d.getVar("QEMU_USE_KVM")
+        if qemu_use_kvm and \
+           (qemu_use_kvm == "True" and "x86" in d.getVar("MACHINE") or \
+            d.getVar("MACHINE") in qemu_use_kvm.split()):
             use_kvm = True
         else:
             use_kvm = False