summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2017-11-14 02:19:22 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-12-18 18:03:56 +0000
commit60ceabb92276ff182042c866b3e6e25fe9ff20d1 (patch)
tree56af10c767c2d82f9411db6d2e9823080e6183eb
parent7c99808915f8d00124648e23840bb41fbe93e964 (diff)
downloadpoky-60ceabb92276ff182042c866b3e6e25fe9ff20d1.tar.gz
targetcontrol.py: use oe.types.boolean for QEMU_USE_KVM
So that both QEMU_USE_KVM = "True" and "1" will work. [YOCTO #12343] (From OE-Core rev: f28890ae2eb8a9cb2da39588e696a4b0c501bdf0) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/testimage.bbclass2
-rw-r--r--meta/lib/oeqa/targetcontrol.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 45bb2bda3b..7260ad4517 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -215,7 +215,7 @@ def testimage_main(d):
215 # Get use_kvm 215 # Get use_kvm
216 qemu_use_kvm = d.getVar("QEMU_USE_KVM") 216 qemu_use_kvm = d.getVar("QEMU_USE_KVM")
217 if qemu_use_kvm and \ 217 if qemu_use_kvm and \
218 (qemu_use_kvm == 'True' and 'x86' in machine or \ 218 (oe.types.boolean(qemu_use_kvm) and 'x86' in machine or \
219 d.getVar('MACHINE') in qemu_use_kvm.split()): 219 d.getVar('MACHINE') in qemu_use_kvm.split()):
220 kvm = True 220 kvm = True
221 else: 221 else:
diff --git a/meta/lib/oeqa/targetcontrol.py b/meta/lib/oeqa/targetcontrol.py
index f63936c3ec..59a9c35a09 100644
--- a/meta/lib/oeqa/targetcontrol.py
+++ b/meta/lib/oeqa/targetcontrol.py
@@ -91,6 +91,8 @@ class QemuTarget(BaseTarget):
91 91
92 def __init__(self, d, logger, image_fstype=None): 92 def __init__(self, d, logger, image_fstype=None):
93 93
94 import oe.types
95
94 super(QemuTarget, self).__init__(d, logger) 96 super(QemuTarget, self).__init__(d, logger)
95 97
96 self.rootfs = '' 98 self.rootfs = ''
@@ -107,7 +109,7 @@ class QemuTarget(BaseTarget):
107 dump_dir = d.getVar("TESTIMAGE_DUMP_DIR") 109 dump_dir = d.getVar("TESTIMAGE_DUMP_DIR")
108 qemu_use_kvm = d.getVar("QEMU_USE_KVM") 110 qemu_use_kvm = d.getVar("QEMU_USE_KVM")
109 if qemu_use_kvm and \ 111 if qemu_use_kvm and \
110 (qemu_use_kvm == "True" and "x86" in d.getVar("MACHINE") or \ 112 (oe.types.boolean(qemu_use_kvm) and "x86" in d.getVar("MACHINE") or \
111 d.getVar("MACHINE") in qemu_use_kvm.split()): 113 d.getVar("MACHINE") in qemu_use_kvm.split()):
112 use_kvm = True 114 use_kvm = True
113 else: 115 else: