common: add --qemu option to override configs

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2018-11-13 00:00:01 +00:00
parent e54635c3ab
commit 238f1ad1c0
8 changed files with 305 additions and 312 deletions

6
run
View File

@@ -127,7 +127,7 @@ def main(args, extra_args=None):
if common.image is None:
raise Exception('Baremetal ELF file not found. Tried:\n' + '\n'.join(paths))
cmd = debug_vm.copy()
if args.gem5:
if common.emulator == 'gem5':
if args.baremetal is None:
if not os.path.exists(common.rootfs_raw_file):
if not os.path.exists(common.qcow2_file):
@@ -359,7 +359,7 @@ def main(args, extra_args=None):
if args.baremetal is None:
cmd.extend(append)
if args.tmux is not None:
if args.gem5:
if common.emulator == 'gem5':
subprocess.Popen([os.path.join(common.root_dir, 'tmu'),
'sleep 2;./gem5-shell -n {} {}' \
.format(args.run_id, args.tmux)
@@ -386,7 +386,7 @@ def main(args, extra_args=None):
out_file = common.termout_file
common.run_cmd(cmd, cmd_file=common.run_cmd_file, out_file=out_file, extra_env=extra_env)
# Check if guest panicked.
if args.gem5:
if common.emulator == 'gem5':
# We have to do some parsing here because gem5 exits with status 0 even when panic happens.
# Grepping for '^panic: ' does not work because some errors don't show that message.
panic_msg = b'--- BEGIN LIBC BACKTRACE ---$'