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 --- stubs/Makefile.objs | 1 + stubs/chr-testdev.c | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 stubs/chr-testdev.c (limited to 'stubs') diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index 528e161..5e347d0 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -2,6 +2,7 @@ stub-obj-y += arch-query-cpu-def.o stub-obj-y += bdrv-commit-all.o stub-obj-y += chr-baum-init.o stub-obj-y += chr-msmouse.o +stub-obj-y += chr-testdev.o stub-obj-y += clock-warp.o stub-obj-y += cpu-get-clock.o stub-obj-y += cpu-get-icount.o diff --git a/stubs/chr-testdev.c b/stubs/chr-testdev.c new file mode 100644 index 0000000..23112a2 --- /dev/null +++ b/stubs/chr-testdev.c @@ -0,0 +1,7 @@ +#include "qemu-common.h" +#include "sysemu/char.h" + +CharDriverState *chr_testdev_init(void) +{ + return 0; +} -- cgit v1.1