diff options
Diffstat (limited to 'scripts/runqemu')
| -rwxr-xr-x | scripts/runqemu | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index 35053de368..ba0b701aff 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
| @@ -1196,6 +1196,15 @@ class BaseConfig(object): | |||
| 1196 | self.fstype = self.fstype[4:] | 1196 | self.fstype = self.fstype[4:] |
| 1197 | rootfs_format = self.fstype if self.fstype in ('vmdk', 'vhd', 'vhdx', 'qcow2', 'vdi') else 'raw' | 1197 | rootfs_format = self.fstype if self.fstype in ('vmdk', 'vhd', 'vhdx', 'qcow2', 'vdi') else 'raw' |
| 1198 | 1198 | ||
| 1199 | tmpfsdir = os.environ.get("RUNQEMU_TMPFS_DIR", None) | ||
| 1200 | if self.snapshot and tmpfsdir: | ||
| 1201 | newrootfs = os.path.join(tmpfsdir, os.path.basename(self.rootfs)) + "." + str(os.getpid()) | ||
| 1202 | shutil.copyfile(self.rootfs, newrootfs) | ||
| 1203 | #print("Copying rootfs to tmpfs: %s" % newrootfs) | ||
| 1204 | self.rootfs = newrootfs | ||
| 1205 | # Don't need a second copy now! | ||
| 1206 | self.snapshot = False | ||
| 1207 | |||
| 1199 | qb_rootfs_opt = self.get('QB_ROOTFS_OPT') | 1208 | qb_rootfs_opt = self.get('QB_ROOTFS_OPT') |
| 1200 | if qb_rootfs_opt: | 1209 | if qb_rootfs_opt: |
| 1201 | self.rootfs_options = qb_rootfs_opt.replace('@ROOTFS@', self.rootfs) | 1210 | self.rootfs_options = qb_rootfs_opt.replace('@ROOTFS@', self.rootfs) |
