Re: [libvirt] [PATCH] unlock eventLoop before calling callback function

2011-03-07 Thread Eric Blake
On 03/07/2011 06:27 AM, Jiri Denemark wrote: > And the rest of the for loops in Cleanup* is safe as well for the reason you > already mentioned. The code moves stuff from i+1 to the end of the array one > position closer the beginning of the array and it will move the possibly added > items as well

Re: [libvirt] [PATCH] unlock eventLoop before calling callback function

2011-03-07 Thread Laine Stump
On 03/07/2011 08:17 AM, Daniel P. Berrange wrote: On Mon, Mar 07, 2011 at 02:13:23PM +0100, Jiri Denemark wrote: On Mon, Mar 07, 2011 at 11:15:38 +, Daniel P. Berrange wrote: -if (eventLoop.handles[i].ff) +if (eventLoop.handles[i].ff) { +virMutexUnlock(&eventLoop

Re: [libvirt] [PATCH] unlock eventLoop before calling callback function

2011-03-07 Thread Jiri Denemark
On Mon, Mar 07, 2011 at 14:18:06 +0100, Jiri Denemark wrote: > On Mon, Mar 07, 2011 at 14:13:23 +0100, Jiri Denemark wrote: > > On Mon, Mar 07, 2011 at 11:15:38 +, Daniel P. Berrange wrote: > > > > -if (eventLoop.handles[i].ff) > > > > +if (eventLoop.handles[i].ff) { > > > > +

Re: [libvirt] [PATCH] unlock eventLoop before calling callback function

2011-03-07 Thread Daniel P. Berrange
On Mon, Mar 07, 2011 at 02:13:23PM +0100, Jiri Denemark wrote: > On Mon, Mar 07, 2011 at 11:15:38 +, Daniel P. Berrange wrote: > > > -if (eventLoop.handles[i].ff) > > > +if (eventLoop.handles[i].ff) { > > > +virMutexUnlock(&eventLoop.lock); > > > (eventL

Re: [libvirt] [PATCH] unlock eventLoop before calling callback function

2011-03-07 Thread Jiri Denemark
On Mon, Mar 07, 2011 at 14:13:23 +0100, Jiri Denemark wrote: > On Mon, Mar 07, 2011 at 11:15:38 +, Daniel P. Berrange wrote: > > > -if (eventLoop.handles[i].ff) > > > +if (eventLoop.handles[i].ff) { > > > +virMutexUnlock(&eventLoop.lock); > > > (eventLoo

Re: [libvirt] [PATCH] unlock eventLoop before calling callback function

2011-03-07 Thread Jiri Denemark
On Mon, Mar 07, 2011 at 11:15:38 +, Daniel P. Berrange wrote: > > -if (eventLoop.handles[i].ff) > > +if (eventLoop.handles[i].ff) { > > +virMutexUnlock(&eventLoop.lock); > > (eventLoop.handles[i].ff)(eventLoop.handles[i].opaque); > > +virMute

Re: [libvirt] [PATCH] unlock eventLoop before calling callback function

2011-03-07 Thread Daniel P. Berrange
On Mon, Mar 07, 2011 at 02:06:49PM +0800, Wen Congyang wrote: > > diff --git a/daemon/event.c b/daemon/event.c > index 1a31717..0d45014 100644 > --- a/daemon/event.c > +++ b/daemon/event.c > @@ -493,8 +493,11 @@ static int virEventCleanupTimeouts(void) { > > EVENT_DEBUG("Purging timeout

[libvirt] [PATCH] unlock eventLoop before calling callback function

2011-03-06 Thread Wen Congyang
When I use newest libvirt to save a domain, libvirtd will be deadlock. Here is the output of gdb: (gdb) thread 3 [Switching to thread 3 (Thread 0x7f972a1fc710 (LWP 30265))]#0 0x00351fe0e034 in __lll_lock_wait () from /lib64/libpthread.so.0 (gdb) bt #0 0x00351fe0e034 in __lll_lock_wait ()