On 15.04.2016 13:53, Richard W.M. Jones wrote:
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.
---
src/fdstream.c | 10 +++---
src/libvirt_private.syms | 2 ++
src/qemu/qemu_agent.c | 9 +++---
src/qemu/qemu_monitor.c | 10 +++---
src/util/virtime.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++++
src/util/virtime.h | 11 +++++++
6 files changed, 111 insertions(+), 12 deletions(-)
ACK. Sorry for making you send v5 to such simple patch.
Michal