aboutsummaryrefslogtreecommitdiff
path: root/chardev/char-serial.c
AgeCommit message (Collapse)AuthorFilesLines
2020-05-04chardev: Add macOS to list of OSes that support -chardev serialMikhail Gusarov1-1/+1
macOS API for dealing with serial ports/ttys is identical to BSDs. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20200426210956.17324-1-dottedmag@dottedmag.net> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2019-06-12Include qemu/module.h where needed, drop it from qemu-common.hMarkus Armbruster1-0/+1
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190523143508.25387-4-armbru@redhat.com> [Rebased with conflicts resolved automatically, except for hw/usb/dev-hub.c hw/misc/exynos4210_rng.c hw/misc/bcm2835_rng.c hw/misc/aspeed_scu.c hw/display/virtio-vga.c hw/arm/stm32f205_soc.c; ui/cocoa.m fixed up]
2019-02-12chardev: ensure termios is fully initializedDaniel P. Berrangé1-1/+1
valgrind on the test-char.c code reports that 'struct termios' contains uninitialized memory. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20190211182442.8542-17-berrange@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2018-07-02serial: Open non-blockDr. David Alan Gilbert1-1/+2
On a real serial device, the open can block if the handshake lines are in a particular state. If a QEMU is passing the serial device to the guest, the QEMU startup is blocked opening the device (with a symptom seen as a timeout from libvirt). Open the serial port with O_NONBLOCK. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
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-0/+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]
2018-01-16chardev: Clean up previous patch indentationEric Blake1-34/+32
The previous patch left in an extra scope layer for ease of review; time to remove it. No semantic change. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20171201232433.25193-5-eblake@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2018-01-16chardev: Use goto/label instead of do/break/while(0)Eric Blake1-3/+10
Use of a do/while(0) control flow in order to permit an early break is an unusual paradigm, and triggers a false positive with a planned future syntax check against 'while (0);'. Rewrite the code to use a goto instead. This patch temporarily keeps an extra level of indentation to highlight the change; the next patch cleans it up. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20171201232433.25193-4-eblake@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-06-02chardev: move headers to include/chardevMarc-André Lureau1-3/+3
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-06-02char-win: rename win_chr_init/poll win_chr_serial_init/pollMarc-André Lureau1-1/+1
Those 2 functions are specific to serial chardev, make it more clear. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
2017-01-31char: move serial chardev to its own fileMarc-André Lureau1-0/+318
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Eric Blake <eblake@redhat.com>