aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils
diff options
context:
space:
mode:
authorBill Randle <william.c.randle@intel.com>2016-08-16 16:08:11 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-18 09:27:53 +0100
commitf479e3866df545dc48544940e5194b318dfcdbbc (patch)
tree10ef7bab99269c563d070a5d482e230bcc6376fd /meta/lib/oeqa/utils
parentff3a455ee84b91e797052760c8d4618109b54c63 (diff)
downloadopenembedded-core-contrib-f479e3866df545dc48544940e5194b318dfcdbbc.tar.gz
testimage: allow using kvm when running qemux86* machines
Using kvm can provide significant speedups when running qemux86* machines on an x86* host. Enabled by using the new QEMU_USE_KVM variable. [YOCTO #9298] (From OE-Core rev: ebac2c8d1fcd09ebce0659a4abb445e4f1c18571) Signed-off-by: Bill Randle <william.c.randle@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils')
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index df73120254..69a5ae1eef 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -29,7 +29,7 @@ re_control_char = re.compile('[%s]' % re.escape("".join(control_chars)))
class QemuRunner:
- def __init__(self, machine, rootfs, display, tmpdir, deploy_dir_image, logfile, boottime, dump_dir, dump_host_cmds):
+ def __init__(self, machine, rootfs, display, tmpdir, deploy_dir_image, logfile, boottime, dump_dir, dump_host_cmds, use_kvm):
# Popen object for runqemu
self.runqemu = None
@@ -49,6 +49,7 @@ class QemuRunner:
self.boottime = boottime
self.logged = False
self.thread = None
+ self.use_kvm = use_kvm
self.runqemutime = 60
self.host_dumper = HostDumper(dump_host_cmds, dump_dir)
@@ -133,7 +134,13 @@ class QemuRunner:
self.origchldhandler = signal.getsignal(signal.SIGCHLD)
signal.signal(signal.SIGCHLD, self.handleSIGCHLD)
- launch_cmd = 'runqemu tcpserial=%s %s %s %s' % (self.serverport, self.machine, self.rootfs, self.qemuparams)
+ launch_cmd = 'runqemu '
+ if self.use_kvm:
+ logger.info('Using kvm for runqemu')
+ launch_cmd += 'kvm '
+ else:
+ logger.info('Not using kvm for runqemu')
+ launch_cmd += 'tcpserial=%s %s %s %s' % (self.serverport, self.machine, self.rootfs, self.qemuparams)
# FIXME: We pass in stdin=subprocess.PIPE here to work around stty
# blocking at the end of the runqemu script when using this within
# oe-selftest (this makes stty error out immediately). There ought