[libvirt-users] Handling connection closes in (older) Sys::Virt

Henrik Ahlgren pablo at seestieto.com
Wed Nov 14 08:15:25 UTC 2012


I hope this is the correct mailing list for discussing the Sys::Virt
Perl module.

It appears that the most recent version has a new method called
register_close_callback that, I believe, can be used to catch errors
when the connection to libvirt is closed, e.g. due to libvirt restart
or a network related issue. (I've been testing this simply by killing
the the SSH process in the libvirt server.)

However, Debian still ships libvirt 0.9.12 in stable backports and
testing, as probably do many other mainstream distributions. The
latest Perl bindings that can be installed from CPAN is thus 0.9.12
and it does not have support for close callbacks. Not only that, when
a Perl program loses the (ssh) connection to libvirt, Perl just
crashes:

Program received signal SIGPIPE, Broken pipe.
0x00007ffff73de0d0 in __write_nocancel () from /lib/libpthread.so.0

Setting a $SIG{PIPE} handler does not seem to help. Is there any
possibility of a Perl program surviving and gracefully handling a
closed libvirt connection with libvirt version 0.9.12 or
older?

Henrik




More information about the libvirt-users mailing list