Skip to content

Commit a8a5686

Browse files
committed
boot-qemu.py: Flush the qemu command print to ensure proper ordering
When writing boot-qemu.py output to a file, the command print will end up at the end, rather than in the spot where it should be if it was running interactively. Flush the IO buffers before running QEMU to ensure the print is consistently where it should be. Signed-off-by: Nathan Chancellor <[email protected]>
1 parent 5b01df8 commit a8a5686

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

boot-qemu.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ def _run_fg(self):
185185

186186
qemu_cmd += [self._qemu_path, *self._qemu_args]
187187

188-
print(f"$ {' '.join(shlex.quote(str(elem)) for elem in qemu_cmd)}")
188+
print(f"$ {' '.join(shlex.quote(str(elem)) for elem in qemu_cmd)}",
189+
flush=True)
189190
try:
190191
subprocess.run(qemu_cmd, check=True)
191192
except subprocess.CalledProcessError as err:

0 commit comments

Comments
 (0)