[libvirt-users] libvirt events and Ruby's EventMachine

Jonathan Barber jonathan.barber at gmail.com
Fri Jul 24 14:21:00 UTC 2015


Hello,

I'm trying to adopt the Ruby event example from here
https://www.libvirt.org/ruby/examples/event_test.rb to use EventMachine (a
library for writing event driven programs).

I have attached my attempt, which appears subscribe to events but never
executes the callbacks I provide. I know this because when I reset domains
(virsh reset VM) I see messages appear from the
Handlers::notify_readable(), which should then invoke
Libvirt::event_invoke_handle_callback() - but the output from the callbacks
never appears. Typical output from the program looks like:
add_handle fd=11 events=1
add_timer interval=-1
:notify_readable id=0 fd=11 events=1
update_timer id=0 interval=0
:notify_readable id=0 fd=11 events=1
:notify_readable id=0 fd=11 events=1
...

When I enabled debugging by setting LIBVIRT_DEBUG to 1 the output from
libvirt appears to be the same as event_test.rb (excluding memory
addresses). Can anyone see where I'm going wrong?

Many thanks
-- 
Jonathan Barber <jonathan.barber at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20150724/8c318488/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libvirt-event-machine.rb
Type: application/x-ruby
Size: 3739 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20150724/8c318488/attachment.bin>


More information about the libvirt-users mailing list