On 18/04/2018 14:06, Peter Maydell wrote: > >> In case of a mux chardev, it may already >> have an active frontend (yeah be is CharBackend which is the frontend, >> I still can't grasp that either, please Paolo change your mind! ;). > I agree with Marc-André that the terminology for our chardev > code is hopelessly confusing. The things that are logically > backends (file, stdio, etc) are called "chardevs", and the > thing that is called the CharBackend is, well, I don't know > what it is. include/chardev/char.h has a helpful comment: > /* character device */ > typedef struct CharBackend CharBackend; > > The doc comments for functions like qemu_chr_new() that return > a Chardev* say they "create a new character backend". > > And then there's ChardevBackend, which is something else again.
Since CharBackend was named like that for consistency with BlockBackend, ChardevBackend could be changed to ChardevOptions and CHARDEV_BACKEND_KIND_* to CHARDEV_DRIVER_*. That would be a good idea indeed. Paolo