Re: [libvirt] [PATCH v2] Add macro for handling exponential backoff loops.

2016-04-08 Thread Richard W.M. Jones
On Fri, Apr 08, 2016 at 05:14:04PM +0200, Ján Tomko wrote: > On Fri, Apr 08, 2016 at 12:57:51PM +0100, 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 suff

Re: [libvirt] [PATCH v2] Add macro for handling exponential backoff loops.

2016-04-08 Thread Ján Tomko
On Fri, Apr 08, 2016 at 12:57:51PM +0100, 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 unnece

[libvirt] [PATCH v2] Add macro for handling exponential backoff loops.

2016-04-08 Thread Richard W.M. Jones
Since v1: - Rename the macro VIR_TIME_WHILE_WITH_BACKOFF. - Split out the variable initialization into a separate function that the user must call explicitly. - The macro is now an atomic C statement. An interesting observation about the qemu monitor socket: In some cases it appears almo

[libvirt] [PATCH v2] Add macro for handling exponential backoff loops.

2016-04-08 Thread 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 tha