Skip to content
  • Andrew Jones's avatar
    runtime: better handling of QEMU aborts · 8727c886
    Andrew Jones authored
    
    
    Add two changes to run_qemu. The first saves/restores terminal settings.
    This solves an annoying loss of terminal echo when QEMU aborts during
    a test run. The second ensures we see a message about the abort, because
    the "Aborted (core dumped)" message we should see gets eaten. We also
    add a message to run()'s failure cases in its exit code processing to
    handle signals in general.
    
    Note, the first change is necessary because QEMU modifies the terminal
    settings when using '-serial stdio', but calling abort() invokes exit
    without first calling qemu_chr_free(serial_hds[0]) to restore them.
    
    (Additionally we fixup the premature failure check to only capture the
     last line, like it says it's doing.)
    
    Reported-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Signed-off-by: default avatarAndrew Jones <drjones@redhat.com>
    [Redirected the abort message to stderr and moved it below `stty`.]
    Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
    8727c886