virtio: Introduce virtio-testdev
PATCH v2 1/1 virtio: Introduce virtio-testdev
This is a virtio version of hw/misc/debugexit and should evolve into a virtio version of pc-testdev. pc-testdev uses the PC's ISA bus, whereas this testdev can be plugged into a virtio-mmio transport, which is needed for kvm-unit-tests/arm. virtio-testdev uses the virtio device config space as a communication channel, and implements an RTAS-like protocol through it allowing guests to execute commands. Only three commands are currently implemented;
1) VERSION: for version compatibility checks
2) CLEAR: set all the config space back to zero
3) EXIT: exit() from qemu with a status code
---
v2:
- No real functional changes, just added some comments and changed register bank accesses to use byte offsets, allowing the driver implementation to better mirror this device's implementation.
--- hw/virtio/Makefile.objs | 1 + hw/virtio/virtio-testdev.c | 154 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 155 insertions(+) create mode 100644 hw/virtio/virtio-testdev.c
hw/virtio/Makefile.objs +1 -0
@@ -3,6 +3,7 @@ common-obj-$(CONFIG_VIRTIO_PCI) += virtio-pci.o common-obj-y += virtio-bus.o common-obj-y += virtio-mmio.o common-obj-$(CONFIG_VIRTIO_BLK_DATA_PLANE) += dataplane/ +common-obj-y += virtio-testdev.o obj-y += virtio.o virtio-balloon.o obj-$(CONFIG_LINUX) += vhost.o
hw/virtio/virtio-testdev.c new file +154 -0
154 lines not on this page · raw message
Signature · 1 line
1.8.1.4