summaryrefslogtreecommitdiffstats
path: root/tests/test-char.c
Commit message (Collapse)AuthorAgeFilesLines
* test-char: add hotswap testAnton Nefedov2017-07-141-0/+71
| | | | | | | Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <1499342940-56739-10-git-send-email-anton.nefedov@virtuozzo.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* test-char: split char_file_testAnton Nefedov2017-07-141-53/+84
| | | | | | | | | makes it possible to test the existing chardev-file Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <1499342940-56739-9-git-send-email-anton.nefedov@virtuozzo.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* test-char: split char_udp_testAnton Nefedov2017-07-141-16/+40
| | | | | | | | | makes it possible to test the existing chardev-udp Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <1499342940-56739-8-git-send-email-anton.nefedov@virtuozzo.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* test-char: destroy chardev-udp after testAnton Nefedov2017-07-141-0/+1
| | | | | | | | | | this is only not a problem if the test is last in a suite, otherwise it makes the following main_loop() calls to fail Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <1499342940-56739-7-git-send-email-anton.nefedov@virtuozzo.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* char: add backend hotswap handlerAnton Nefedov2017-07-141-4/+10
| | | | | | | | | | | Frontends should have an interface to setup the handler of a backend change. The interface will be used in the next commits Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <1499342940-56739-3-git-send-email-anton.nefedov@virtuozzo.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* tests/test-char.c: Don't use main_loop_wait()'s return valuePeter Maydell2017-07-041-5/+1Star
| | | | | | | | | | | | | | | | | In QEMU's main_loop() we used to check whether we should do a nonblocking call to main_loop(); this was deleted in commit e330c118f2a5, because now that vCPUs always drop the I/O thread lock it is an unnecessary optimization. The loop in test-char.c copied the old QEMU main_loop() code, but here the nonblocking check has never been necessary because this standalone test case doesn't hold the I/O lock anyway. Remove it, so we can drop the main_loop_wait() return value. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <1498584769-12439-2-git-send-email-peter.maydell@linaro.org> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* Add chardev-send-break monitor commandStefan Fritsch2017-06-291-2/+10
| | | | | | | | | | | | | | | Sending a break on a serial console can be useful for debugging the guest. But not all chardev backends support sending breaks (only telnet and mux do). The chardev-send-break command allows to send a break even if using other backends. Signed-off-by: Stefan Fritsch <sf@sfritsch.de> Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20170611074817.13621-1-sf@sfritsch.de> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Use 'send a break' in all 3 pieces of text as suggested by eblake
* test-char: start a /char/serial testMarc-André Lureau2017-06-081-0/+29
| | | | | | | | Quite limited test, to check that the chardev can be created with a path and with the tty alias. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
* char: make chr_fe_deinit() optionaly delete backendMarc-André Lureau2017-06-021-14/+8Star
| | | | | | | | | | | This simplifies removing a backend for a frontend user (no need to retrieve the associated driver and separate delete call etc). NB: many frontends have questionable handling of ending a chardev. They should probably delete the backend to prevent broken reusage. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
* char: move CharBackend handling in char-fe unitMarc-André Lureau2017-06-021-1/+1
| | | | | | | | | | | | | | Move all the frontend struct and methods to a seperate unit. This avoids accidentally mixing backend and frontend calls, and helps with readabilty. Make qemu_chr_replay() a macro shared by both char and char-fe. Export qemu_chr_write(), and use a macro for qemu_chr_write_all() (nb: yes, CharBackend is for char frontend :) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
* chardev: move headers to include/chardevMarc-André Lureau2017-06-021-1/+1
| | | | | | | | 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>
* sockets: Limit SocketAddressLegacy to external interfacesMarkus Armbruster2017-05-091-3/+2Star
| | | | | | | | | | | | | | | | | SocketAddressLegacy is a simple union, and simple unions are awkward: they have their variant members wrapped in a "data" object on the wire, and require additional indirections in C. SocketAddress is the equivalent flat union. Convert all users of SocketAddressLegacy to SocketAddress, except for existing external interfaces. See also commit fce5d53..9445673 and 85a82e8..c5f1ae3. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1493192202-3184-7-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [Minor editing accident fixed, commit message and a comment tweaked] Signed-off-by: Markus Armbruster <armbru@redhat.com>
* tests: add /char/console testMarc-André Lureau2017-05-041-1/+30
| | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* tests: add /char/udp testMarc-André Lureau2017-05-041-0/+46
| | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* tests: add /char/socket testMarc-André Lureau2017-05-041-2/+112
| | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* tests: add /char/file testMarc-André Lureau2017-05-041-0/+71
| | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* tests: add /char/pipe testMarc-André Lureau2017-05-041-0/+90
| | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* tests: add alias check in /char/ringbufMarc-André Lureau2017-05-041-0/+10
| | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* char: add a /chardevs containerMarc-André Lureau2017-05-041-4/+4
| | | | | | | Add a /chardevs container object to hold the list of chardevs. (Note: QTAILQ chardevs is going away in the following commits) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* char: rename CharDriverState ChardevMarc-André Lureau2017-01-271-5/+5
| | | | | | | | Pick a uniform chardev type name. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* char: remove explicit_fe_open, use a set_handlers argumentMarc-André Lureau2016-10-241-4/+4
| | | | | | | | | No need to keep explicit_fe_open around if it affects only a qemu_chr_fe_set_handlers(). Use an additional argument instead. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20161022095318.17775-24-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* tests: start chardev unit testsMarc-André Lureau2016-10-241-0/+253
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20161022095318.17775-21-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>