]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
scripts/runqemu: Add snapshot support
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 6 Sep 2016 13:42:40 +0000 (14:42 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 9 Sep 2016 11:06:54 +0000 (12:06 +0100)
Allow access to the snapshot option of qemu to simplify some of our runtime
testing to avoid copying images.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/runqemu

index fca8d1d29d19fc3e4c6cd81512c1ee4eb4489f13..9af13f3360d966d4ae80b9378fab6d8f208b7e85 100755 (executable)
@@ -162,6 +162,7 @@ class BaseConfig(object):
         self.lock = ''
         self.lock_descriptor = ''
         self.bitbake_e = ''
+        self.snapshot = False
         self.fstypes = ('ext2', 'ext3', 'ext4', 'jffs2', 'nfs', 'btrfs', 'cpio.gz', 'cpio', 'ramfs')
         self.vmtypes = ('hddimg', 'hdddirect', 'wic', 'vmdk', 'qcow2', 'vdi', 'iso')
 
@@ -328,6 +329,8 @@ class BaseConfig(object):
                 self.vhost_enabled = True
             elif arg == 'slirp':
                 self.slirp_enabled = True
+            elif arg == 'snapshot':
+                self.snapshot = True
             elif arg == 'publicvnc':
                 self.qemu_opt_script += ' -vnc :0'
             elif arg.startswith('tcpserial='):
@@ -809,6 +812,9 @@ class BaseConfig(object):
         # Enable virtio RNG else we can run out of entropy in guests
         self.qemu_opt += " -device virtio-rng-pci"
 
+        if self.snapshot:
+            self.qemu_opt += " -snapshot"
+
         if self.serialstdio:
             logger.info("Interrupt character is '^]'")
             cmd = "stty intr ^]"