aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils/qemurunner.py
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2017-03-28 10:02:19 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-28 09:16:10 +0100
commit969d079a33a57f5a8f7af86d7bab04d35ab07584 (patch)
tree8023896281e605154aac2a5b90ef6a97d5bc0481 /meta/lib/oeqa/utils/qemurunner.py
parent4c6ba32abd6b9de33f4b8a0b87e8a56432ed7825 (diff)
downloadopenembedded-core-contrib-969d079a33a57f5a8f7af86d7bab04d35ab07584.tar.gz
oeqa: allow persistent image writes in runqemu()
By default, QemuRunner avoids modifying the image files that it boots into by enabling the qemu snapshot mode. However, some tests may want to test changes that must persists across reboots, so this mode should be optional. This can be combined by copying the image file to a temporary location first and then booting with that copy. It's also useful when testing with additional drives attached to a virtual machine. QemuTinyRunner doesn't use the snapshot parameter and therefore ignores the new parameter. Long term, a better way of passing these various configuration parameters should be used, and perhaps QemuRunner and QemuTinyRunner can be merged into one again to avoid code duplication. But for now the patch follows the exiting style. Also beware that QemuTarget.start() now acts in two different modes (with or without explicit launch command), and depending on that mode parameters like discard_writes must be ignored, i.e. not get passed to launch(). Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils/qemurunner.py')
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index b7816167e8..ba44b96f53 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -97,7 +97,7 @@ class QemuRunner:
self._dump_host()
raise SystemExit
- def start(self, qemuparams = None, get_ip = True, extra_bootparams = None, runqemuparams='', launch_cmd=None):
+ def start(self, qemuparams = None, get_ip = True, extra_bootparams = None, runqemuparams='', launch_cmd=None, discard_writes=True):
if self.display:
os.environ["DISPLAY"] = self.display
# Set this flag so that Qemu doesn't do any grabs as SDL grabs
@@ -118,7 +118,7 @@ class QemuRunner:
os.environ["DEPLOY_DIR_IMAGE"] = self.deploy_dir_image
if not launch_cmd:
- launch_cmd = 'runqemu snapshot %s' % runqemuparams
+ launch_cmd = 'runqemu %s %s ' % ('snapshot' if discard_writes else '', runqemuparams)
if self.use_kvm:
logger.info('Using kvm for runqemu')
launch_cmd += ' kvm'