From 232cb7b0553f844be695d26f55aaf531029a6a9a Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 31 Mar 2021 22:41:52 +0100 Subject: oeqa/runqemu: Support RUNQEMU_TMPFS_DIR as a location to copy snapshot images to We have a working theory that IO queues on the autobuilder are impacting runtime testing under qemu, particularly async writes which inice does not influence. We already pass the snapshot option to qemu which copies the image and runs out of the copy. Add in the ability to copy the image to a specificed location which can be a tmpfs. This means that writes to the image would no longer be blocked by other writes to disk in the system. Preliminary tests show that this does improve the qemu errors at the expense of sometimes showing qemu startup timeouts as on a loaded system with a large test image, it can take longer than 120s to copy the image to tmpfs. Having a most consistent failure mode for loaded tests is probably desireable though. (From OE-Core rev: fd1c26ab426c3699ffd8082b83d65a84c8eb8bff) Signed-off-by: Richard Purdie --- meta/lib/oeqa/utils/qemurunner.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'meta/lib/oeqa/utils/qemurunner.py') diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index eb23dbceb8..278904ba0b 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py @@ -32,7 +32,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, - use_kvm, logger, use_slirp=False, serial_ports=2, boot_patterns = defaultdict(str), use_ovmf=False, workdir=None): + use_kvm, logger, use_slirp=False, serial_ports=2, boot_patterns = defaultdict(str), use_ovmf=False, workdir=None, tmpfsdir=None): # Popen object for runqemu self.runqemu = None @@ -61,6 +61,7 @@ class QemuRunner: self.serial_ports = serial_ports self.msg = '' self.boot_patterns = boot_patterns + self.tmpfsdir = tmpfsdir self.runqemutime = 120 if not workdir: @@ -150,6 +151,9 @@ class QemuRunner: else: env["DEPLOY_DIR_IMAGE"] = self.deploy_dir_image + if self.tmpfsdir: + env["RUNQEMU_TMPFS_DIR"] = self.tmpfsdir + if not launch_cmd: launch_cmd = 'runqemu %s' % ('snapshot' if discard_writes else '') if self.use_kvm: -- cgit v1.2.3-54-g00ecf