[libvirt-users] Trouble using virStream with callbacks

Daniel P. Berrange berrange at redhat.com
Fri Sep 20 09:14:24 UTC 2013


On Thu, Sep 19, 2013 at 05:43:58PM -0400, Jonathan Lebon wrote:
> > 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.

It is perfectly fine to use a single thread for everything. The only
reason virsh console doesn't do that, is that events were retrofitted
to existing code which wasn't event loop friendly, so we had to use a
second thread. One day we might fix virsh to only use one thread....

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvirt-users mailing list