]> git.ipfire.org Git - thirdparty/libvirt.git/commit
libvirt-guests: Wait for libvirtd to initialize
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 21 Feb 2014 11:46:08 +0000 (12:46 +0100)
committerCole Robinson <crobinso@redhat.com>
Mon, 10 Mar 2014 13:16:41 +0000 (09:16 -0400)
commit73307499df38bc965b892d1f6cd97ff069255429
treee6ac6ab082484cc37ad2617d3b0868812b6d51fd
parent484cec0b4e00882610b3b370a8ed94eef755dae6
libvirt-guests: Wait for libvirtd to initialize

I've noticed that in some cases systemd was quick enough and even
if libvirt-guests.service is marked to be started after the
libvirtd.service my guests were not resumed as
libvirt-guests.sh failed to connect. This is because of a
simple fact: systemd correctly starts libvirt-guests after it
execs libvirtd. However, the daemon is not able to accept
connections right from the start. It's doing some
initialization which may take ages. This problem is not limited
to systemd only, indeed. Any init system that is able to startup
services in parallel (e.g. OpenRC) may run into this situation.
The fix is to try connecting not only once, but continuously a few
times with a small sleep in between tries.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 4e7fc8305a53676ba2362bfaa8ca05c4851b7e12)
tools/libvirt-guests.sh.in