summaryrefslogtreecommitdiffstats
path: root/backends/testdev.c
Commit message (Collapse)AuthorAgeFilesLines
* qemu-char: convert testdev backend to data-driven creationPaolo Bonzini2015-10-191-2/+5
| | | | | Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qemu-char: add create to register_char_driverPaolo Bonzini2015-10-141-1/+2
| | | | | | | | | | | | | Having creation as a member of the CharDriver struct removes the need to export functions for qemu-char.c's usage. After the conversion, chardev backends implemented outside qemu-char.c will not need a stub creation function anymore. Ultimately all drivers will be converted. For now, support the case where cd->create == NULL. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qemu-char: Use g_new() & friends where that makes obvious senseMarkus Armbruster2015-09-161-2/+2
| | | | | | | | | | | | | | g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, for two reasons. One, it catches multiplication overflowing size_t. Two, it returns T * rather than void *, which lets the compiler catch more type errors. This commit only touches allocations with size arguments of the form sizeof(T). Same Coccinelle semantic patch as in commit b45c03f. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1442231643-23630-1-git-send-email-armbru@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qemu-char: Rename register_char_driver_qapi() to register_char_driver()Peter Maydell2014-09-161-1/+1
| | | | | | | | | Now we have removed the legacy register_char_driver() we can rename register_char_driver_qapi() to the more obvious and shorter name. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1409653457-27863-6-git-send-email-peter.maydell@linaro.org
* backends: Introduce chr-testdevPaolo Bonzini2014-08-061-0/+131
From: Paolo Bonzini <pbonzini@redhat.com> chr-testdev enables a virtio serial channel to be used for guest initiated qemu exits. hw/misc/debugexit already enables guest initiated qemu exits, but only for PC targets. chr-testdev supports any virtio-capable target. kvm-unit-tests/arm is already making use of this backend. Currently there is a single command implemented, "q". It takes a (prefix) argument for the exit code, thus an exit is implemented by writing, e.g. "1q", to the virtio-serial port. It can be used as: $QEMU ... \ -device virtio-serial-device \ -device virtserialport,chardev=ctd -chardev testdev,id=ctd or, use: $QEMU ... \ -device virtio-serial-device \ -device virtconsole,chardev=ctd -chardev testdev,id=ctd to bind it to virtio-serial port0. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
OpenPOWER on IntegriCloud