aboutsummaryrefslogtreecommitdiff
path: root/chardev/char-stdio.c
AgeCommit message (Collapse)AuthorFilesLines
2018-06-28chardev: don't splatter terminal settings on exit if not previously setDaniel P. Berrangé1-2/+4
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>
2018-06-08chardev: Restore CR,LF on stdioPhilippe Mathieu-Daudé1-1/+1
Remove the 'stair-step output' on stdio. This partially reverts commit 12fb0ac05, which was correct on the mailing list but got corrupted by the maintainer :p Introduced-by: 3b876140-c035-dd39-75d0-d54c48128fac@redhat.com Reported-by: BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: Thomas Huth <thuth@redhat.com> Tested-by: Laurent Desnogues <laurent.desnogues@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20180607210818.12727-1-f4bug@amsat.org Suggested-by: Thomas Huth <thuth@redhat.com> Tested-by: Laurent Desnogues <laurent.desnogues@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-06-01char: Remove unwanted crlf conversionPatryk Olszewski1-1/+1
This patch fixes a bug in serial that made it almost impossible for guest to communicate with devices through host's serial. OPOST flag in c_oflag enables output processing letting other flags in c_oflag take effect. Usually in c_oflag ONLCR flag is also set, which causes crlf to be sent in place of lf. This breaks binary transmissions. Unsetting OPOST flag turns off any output processing which fixes the bug. Bug reports related: https://bugs.launchpad.net/qemu/+bug/1772086 https://bugs.launchpad.net/qemu/+bug/1407813 https://bugs.launchpad.net/qemu/+bug/1715296 also https://lists.nongnu.org/archive/html/qemu-devel/2006-06/msg00196.html Signed-off-by: Patryk Olszewski <patryk@fala.ehost.pl> Message-Id: <1527105041-21013-1-git-send-email-patryk@fala.ehost.pl> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2018-02-09Move include qemu/option.h from qemu-common.h to actual usersMarkus Armbruster1-1/+2
qemu-common.h includes qemu/option.h, but most places that include the former don't actually need the latter. Drop the include, and add it to the places that actually need it. While there, drop superfluous includes of both headers, and separate #include from file comment with a blank line. This cleanup makes the number of objects depending on qemu/option.h drop from 4545 (out of 4743) to 284 in my "build everything" tree. Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20180201111846.21846-20-armbru@redhat.com> [Semantic conflict with commit bdd6a90a9e in block/nvme.c resolved]
2017-06-02chardev: move headers to include/chardevMarc-André Lureau1-4/+4
So they are all in one place. The following patch will move serial & parallel declarations to the respective headers. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
2017-01-31char: move stdio in its own fileMarc-André Lureau1-0/+164
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Eric Blake <eblake@redhat.com>