• R
    Add functions for handling exponential backoff loops. · 843ffe8a
    Richard W.M. Jones 提交于
    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: NRichard W.M. Jones <rjones@redhat.com>
    (cherry picked from commit beaa447a)
    843ffe8a
qemu_monitor.c 93.9 KB