From 5692399f0af2b48b164b3c0b5c4c532b186b33ae Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 11 Jul 2014 09:44:26 +0200 Subject: backends: Introduce chr-testdev From: Paolo Bonzini 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 Signed-off-by: Andrew Jones Signed-off-by: Paolo Bonzini --- include/sysemu/char.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/sysemu/char.h b/include/sysemu/char.h index 0bbd631e72..98cd4c958e 100644 --- a/include/sysemu/char.h +++ b/include/sysemu/char.h @@ -358,6 +358,9 @@ CharDriverState *qemu_char_get_next_serial(void); /* msmouse */ CharDriverState *qemu_chr_open_msmouse(void); +/* testdev.c */ +CharDriverState *chr_testdev_init(void); + /* baum.c */ CharDriverState *chr_baum_init(void); -- cgit v1.2.3