]> xenbits.xensource.com Git - libvirt.git/commit
Add functions for handling exponential backoff loops.
authorRichard W.M. Jones <rjones@redhat.com>
Fri, 8 Apr 2016 11:11:10 +0000 (12:11 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Fri, 15 Apr 2016 15:54:28 +0000 (16:54 +0100)
commitbeaa447a2982bc78adb26c183560d0ee566c1268
tree2179753a2bcf863950c11bef91c5e428a9631b57
parent03e750f35d6d8cc39dcdeb893b96e732bd2315ef
Add functions for handling exponential backoff loops.

In a few places in libvirt we busy-wait for events, for example qemu
creating a monitor socket.  This is problematic because:

 - We need to choose a sufficiently small polling period so that
   libvirt doesn't add unnecessary delays.

 - We need to choose a sufficiently large polling period so that
   the effect of busy-waiting doesn't affect the system.

The solution to this conflict is to use an exponential backoff.

This patch adds two functions to hide the details, and modifies a few
places where we currently busy-wait.

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
src/fdstream.c
src/libvirt_private.syms
src/qemu/qemu_agent.c
src/qemu/qemu_monitor.c
src/util/virtime.c
src/util/virtime.h