Il 11/06/2014 16:01, Andrew Jones ha scritto: > virtio-testdev is a communication channel to qemu through virtio that > can be used by test code to send commands. The only command currently > implemented is EXIT, which allows the test code to exit with a given > status code. > > Signed-off-by: Andrew Jones > Reviewed-by: Christoffer Dall Hi Drew, quite a few months ago I had promised to help with an alternative implementation that does not require a new virtio device (which would in turn need registration of the device ID and so on. Since the return values are hardly used in your test device, I removed them and made a simple write-only backend for virtio-serial. With this simplification, virtio-serial is almost as simple as your test device, you just use the transmit queue (queue 1). Receiving data would be a bit more complicated, basically you would first put a buffer in queue 0, then issue the command, then wait for an interrupt on queue 0. There is a single command implemented, "q". It takes a (prefix) argument for the exit code, so an error exit is implemented by writing "1q" to the virtio-serial port. Right now I'm using ASCII (because I tested it from a Linux guest with just "echo 1q > /dev/vport0p1"), but of course you could just as well encode arguments in binary format. The QEMU implementation follows, it can be used as: qemu-system-arm ... \ -chardev testdev,id=ctl \ -device virtio-serial -device virtserialport,chardev=ctl ... If you are okay with it, feel free to pick it up and send it to qemu-devel, and just send v6 of this one patch. Unfortunately I cannot merge kvm-unit-tests until there is QEMU support for either virtio-testdev or chardev-testdev, but it should not take much time. Paolo