As a test why not try hacking virsh console so that it connects to
your
virtio serial port, instead of a console. If we assume 'virsh console'
is bug-free, that would let you identify whether the flaw is in your host
code, or the guest side.
Thanks for the pointer. Doing a few trivial changes to virsh-console does
show that it works correctly and pointed out multiple errors in the
original code (not least of which using VIR_EVENT_* constants instead of
VIR_STREAM_EVENT_*).
I have one more question, are there any risks associated with abandoning
threads and just doing the virEventRunDefaultImpl() in a loop after setting
up all the callbacks? I'm trying to keep this as simple as possible.
Cheers,
Jonathan