]> code.ossystems Code Review - openembedded-core.git/commitdiff
qemurunner: add runqemuparams argument to commands.runqemu
authorEd Bartosh <ed.bartosh@linux.intel.com>
Mon, 6 Mar 2017 15:10:09 +0000 (17:10 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 8 Mar 2017 11:13:46 +0000 (11:13 +0000)
Added possibility to pass additional runqemu parameters
down the stack of APIs:
 commands.runqemu -> QemuTarget.start -> QemuRunner.start

This will be used to pass ovmf parameter in testing of
efi wic images under qemu.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/lib/oeqa/targetcontrol.py
meta/lib/oeqa/utils/commands.py
meta/lib/oeqa/utils/qemurunner.py
meta/lib/oeqa/utils/qemutinyrunner.py

index d1f441f8418edde5d0ffe2a5c86d08a7913be762..dbd2c7ca1ecb2fcb31fd560ec2642422ebbfd702 100644 (file)
@@ -176,8 +176,8 @@ class QemuTarget(BaseTarget):
         bb.note("Qemu log file: %s" % self.qemulog)
         super(QemuTarget, self).deploy()
 
-    def start(self, params=None, ssh=True, extra_bootparams=None):
-        if self.runner.start(params, get_ip=ssh, extra_bootparams=extra_bootparams):
+    def start(self, params=None, ssh=True, extra_bootparams=None, runqemuparams=''):
+        if self.runner.start(params, get_ip=ssh, extra_bootparams=extra_bootparams, runqemuparams=runqemuparams):
             if ssh:
                 self.ip = self.runner.ip
                 self.server_ip = self.runner.server_ip
index 0425c9fd98c7e8074ced6222156f5a1c2a393f50..73ede2379f36ba592d5ccbbe27f444508cc5c680 100644 (file)
@@ -218,7 +218,7 @@ def create_temp_layer(templayerdir, templayername, priority=999, recipepathspec=
 
 
 @contextlib.contextmanager
-def runqemu(pn, ssh=True):
+def runqemu(pn, ssh=True, runqemuparams=''):
 
     import bb.tinfoil
     import bb.build
@@ -260,7 +260,7 @@ def runqemu(pn, ssh=True):
     try:
         qemu.deploy()
         try:
-            qemu.start(ssh=ssh)
+            qemu.start(ssh=ssh, runqemuparams=runqemuparams)
         except bb.build.FuncFailed:
             raise Exception('Failed to start QEMU - see the logs in %s' % logdir)
 
index 21bc35a32c6fe8b280430192089425ae0479ee95..19f0f92b745898878e29d2aa4791ac67084e4464 100644 (file)
@@ -95,7 +95,7 @@ class QemuRunner:
                 self._dump_host()
                 raise SystemExit
 
-    def start(self, qemuparams = None, get_ip = True, extra_bootparams = None):
+    def start(self, qemuparams = None, get_ip = True, extra_bootparams = None, runqemuparams=''):
         if self.display:
             os.environ["DISPLAY"] = self.display
             # Set this flag so that Qemu doesn't do any grabs as SDL grabs
@@ -136,7 +136,7 @@ class QemuRunner:
         self.origchldhandler = signal.getsignal(signal.SIGCHLD)
         signal.signal(signal.SIGCHLD, self.handleSIGCHLD)
 
-        launch_cmd = 'runqemu snapshot '
+        launch_cmd = 'runqemu snapshot %s ' % runqemuparams
         if self.use_kvm:
             logger.info('Using kvm for runqemu')
             launch_cmd += 'kvm '
index d554f0dbcd8043b657757ca6a9bef920daa4160d..ec524738344f738a6723c2ff34eab7ea6097804a 100644 (file)
@@ -60,7 +60,7 @@ class QemuTinyRunner(QemuRunner):
             with open(self.logfile, "a") as f:
                 f.write("%s" % msg)
 
-    def start(self, qemuparams = None, ssh=True, extra_bootparams=None):
+    def start(self, qemuparams = None, ssh=True, extra_bootparams=None, runqemuparams=''):
 
         if self.display:
             os.environ["DISPLAY"] = self.display