Skip to content

Commit 3e506e1

Browse files
committed
qemu: Allow specifying qemu console log file with QEMU_CONSOLE_LOG
1 parent 57a9bbb commit 3e506e1

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

lib/qemu.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ def qemu_main(qemu_machine, cpuinfo_platform, cpu, net, args):
197197
rc = subprocess.run(cmd, shell=True).returncode
198198
return rc == 0
199199

200-
p.spawn(cmd, logfile=open('console.log', 'w'))
200+
logpath = get_env_var('QEMU_CONSOLE_LOG', 'console.log')
201+
p.spawn(cmd, logfile=open(logpath, 'w'))
201202

202203
if cloud_image:
203204
standard_boot(p, prompt=prompt, login=True, password='linuxppc', timeout=boot_timeout)
@@ -229,8 +230,8 @@ def qemu_main(qemu_machine, cpuinfo_platform, cpu, net, args):
229230
p.send('halt')
230231
p.wait_for_exit(timeout=boot_timeout)
231232

232-
if filter_log_warnings(open('console.log'), open('warnings.txt', 'w')):
233-
logging.error('Errors/warnings seen in console.log')
233+
if filter_log_warnings(open(logpath), open('warnings.txt', 'w')):
234+
logging.error('Errors/warnings seen in console log')
234235
return False
235236

236237
logging.info('Test completed OK')

0 commit comments

Comments
 (0)