diff options
Diffstat (limited to 'meta/lib/oeqa/utils/qemurunner.py')
-rw-r--r-- | meta/lib/oeqa/utils/qemurunner.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index ba44b96f53..cd60ba71a3 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py | |||
@@ -98,11 +98,12 @@ class QemuRunner: | |||
98 | raise SystemExit | 98 | raise SystemExit |
99 | 99 | ||
100 | def start(self, qemuparams = None, get_ip = True, extra_bootparams = None, runqemuparams='', launch_cmd=None, discard_writes=True): | 100 | def start(self, qemuparams = None, get_ip = True, extra_bootparams = None, runqemuparams='', launch_cmd=None, discard_writes=True): |
101 | env = os.environ.copy() | ||
101 | if self.display: | 102 | if self.display: |
102 | os.environ["DISPLAY"] = self.display | 103 | env["DISPLAY"] = self.display |
103 | # Set this flag so that Qemu doesn't do any grabs as SDL grabs | 104 | # Set this flag so that Qemu doesn't do any grabs as SDL grabs |
104 | # interact badly with screensavers. | 105 | # interact badly with screensavers. |
105 | os.environ["QEMU_DONT_GRAB"] = "1" | 106 | env["QEMU_DONT_GRAB"] = "1" |
106 | if not os.path.exists(self.rootfs): | 107 | if not os.path.exists(self.rootfs): |
107 | logger.error("Invalid rootfs %s" % self.rootfs) | 108 | logger.error("Invalid rootfs %s" % self.rootfs) |
108 | return False | 109 | return False |
@@ -110,12 +111,12 @@ class QemuRunner: | |||
110 | logger.error("Invalid TMPDIR path %s" % self.tmpdir) | 111 | logger.error("Invalid TMPDIR path %s" % self.tmpdir) |
111 | return False | 112 | return False |
112 | else: | 113 | else: |
113 | os.environ["OE_TMPDIR"] = self.tmpdir | 114 | env["OE_TMPDIR"] = self.tmpdir |
114 | if not os.path.exists(self.deploy_dir_image): | 115 | if not os.path.exists(self.deploy_dir_image): |
115 | logger.error("Invalid DEPLOY_DIR_IMAGE path %s" % self.deploy_dir_image) | 116 | logger.error("Invalid DEPLOY_DIR_IMAGE path %s" % self.deploy_dir_image) |
116 | return False | 117 | return False |
117 | else: | 118 | else: |
118 | os.environ["DEPLOY_DIR_IMAGE"] = self.deploy_dir_image | 119 | env["DEPLOY_DIR_IMAGE"] = self.deploy_dir_image |
119 | 120 | ||
120 | if not launch_cmd: | 121 | if not launch_cmd: |
121 | launch_cmd = 'runqemu %s %s ' % ('snapshot' if discard_writes else '', runqemuparams) | 122 | launch_cmd = 'runqemu %s %s ' % ('snapshot' if discard_writes else '', runqemuparams) |
@@ -128,9 +129,9 @@ class QemuRunner: | |||
128 | launch_cmd += ' nographic' | 129 | launch_cmd += ' nographic' |
129 | launch_cmd += ' %s %s' % (self.machine, self.rootfs) | 130 | launch_cmd += ' %s %s' % (self.machine, self.rootfs) |
130 | 131 | ||
131 | return self.launch(launch_cmd, qemuparams=qemuparams, get_ip=get_ip, extra_bootparams=extra_bootparams) | 132 | return self.launch(launch_cmd, qemuparams=qemuparams, get_ip=get_ip, extra_bootparams=extra_bootparams, env=env) |
132 | 133 | ||
133 | def launch(self, launch_cmd, get_ip = True, qemuparams = None, extra_bootparams = None): | 134 | def launch(self, launch_cmd, get_ip = True, qemuparams = None, extra_bootparams = None, env = None): |
134 | try: | 135 | try: |
135 | threadsock, threadport = self.create_socket() | 136 | threadsock, threadport = self.create_socket() |
136 | self.server_socket, self.serverport = self.create_socket() | 137 | self.server_socket, self.serverport = self.create_socket() |
@@ -157,7 +158,7 @@ class QemuRunner: | |||
157 | # blocking at the end of the runqemu script when using this within | 158 | # blocking at the end of the runqemu script when using this within |
158 | # oe-selftest (this makes stty error out immediately). There ought | 159 | # oe-selftest (this makes stty error out immediately). There ought |
159 | # to be a proper fix but this will suffice for now. | 160 | # to be a proper fix but this will suffice for now. |
160 | self.runqemu = subprocess.Popen(launch_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, stdin=subprocess.PIPE, preexec_fn=os.setpgrp) | 161 | self.runqemu = subprocess.Popen(launch_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, stdin=subprocess.PIPE, preexec_fn=os.setpgrp, env=env) |
161 | output = self.runqemu.stdout | 162 | output = self.runqemu.stdout |
162 | 163 | ||
163 | # | 164 | # |