Re: [Qemu-devel] virtio-serial: A guest <-> host interface for simple communication

Christian Bornträger
2009-06-23T13:58:35Z

Am Dienstag 23 Juni 2009 14:55:52 schrieb Paul Brook:
> > Here are two patches. One implements a virtio-serial device in qemu
> > and the other is the driver for a guest kernel.
>
> So I'll ask again. Why is this separate from virtio-console?

I did some work on virtio-console, since kvm on s390 does not provide any other.
I dont think we should mix two different types of devices into one driver. The
only thing that these drivers have in common, is the fact that there are two
virtqueues, piping data (single bytes or larger chunks). So you could make the
same argument with the first virtio_net driver (the one before GSO) - which is
obviously wrong. The common part of the transport is already factored out to
virtio_ring and the transports.

In addition there are two ABIs involved: a userspace ABI (/dev/hvc0) and a
guest/host ABI for this console. (and virtio was not meant to be a KVM-only
interface, that we can change all the time). David A. Wheeler's 'SLOCCount'
gives me 141 lines of code for virtio_console.c. I am quite confident that the
saving we could achieve by merging these two drivers is not worth the hazzle.

Discussion about merging the console code into this distracts from the main
problem: To get the interface and functionality right before it becomes an ABI
(is it /dev/ttyS, network like or is it something completely different?).

Christian