diff options
| author | Daniel P. Berrangé | 2018-06-04 14:30:43 +0200 |
|---|---|---|
| committer | Paolo Bonzini | 2018-06-28 19:05:30 +0200 |
| commit | 1507bd136fd9a516226fce8738d361a64f45b699 (patch) | |
| tree | a159e1edc95f6da87b90c40ce5f43673c3e30026 /include | |
| parent | move public invalidate APIs out of translate-all.{c,h}, clean up (diff) | |
| download | qemu-1507bd136fd9a516226fce8738d361a64f45b699.tar.gz qemu-1507bd136fd9a516226fce8738d361a64f45b699.tar.xz qemu-1507bd136fd9a516226fce8738d361a64f45b699.zip | |
chardev: don't splatter terminal settings on exit if not previously set
The stdio chardev finalize method calls term_exit() to restore the
original terminal settings that were saved in the "oldtty" global. If
the qemu_chr_open_stdio() method exited with an error, we might not have
any original terminal settings saved in "oldtty" yet.
eg
$ qemu-system-x86_64 -monitor stdio -daemonize
qemu-system-x86_64: -monitor stdio: cannot use stdio with -daemonize
will cause QEMU to splatter the terminal settings with an all-zeros
"struct termios", with predictably unpleasant results. Fortunately the
existing "stdio_in_use" flag is suitable witness for whether "oldtty"
contains settings that need restoring.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20180604123043.13985-1-berrange@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions
