[libvirt] [PATCH] qemu: drop driver lock around sleep

Michal Privoznik mprivozn at redhat.com
Mon Nov 7 10:32:45 UTC 2011


On 05.11.2011 02:49, Eric Blake wrote:
> qemu/THREADS.txt is explicit that the driver lock must not be
> held for long lengths of time, as it blocks all attempts to
> manage any other vms on the same connection.  We were violating
> this by sleep()ing while waiting for a qemu child process to
> finish execution during actions such as destroy.
> 
> * src/qemu/qemu_process.h (qemuProcessKill): Alter signature.
> * src/qemu/qemu_process.c (qemuProcessKill): Add parameter.
> (qemuProcessFakeReboot, qemuProcessShutdownOrReboot)
> (qemuProcessStop): Update callers.
> * src/qemu/qemu_driver.c (qemuDomainDestroyFlags): Likewise.
> ---
> 
> Without this patch, problems in halting one domain could lock
> out actions on all other domains for more than 3 seconds, which
> is awfully long.
> 
> This doesn't solve all the problems - it is still possible to
> have a stuck NFS server being the reason for difficulties in
> stopping a domain, such as an lstat() call while attempting to
> relabel file systems, and those calls are still done while
> the driver lock is held; but I'll be submitting further patches
> as I try and reduce the critical section sizes.
> 
> I'm not sure whether this qualifies for 0.9.7 or should wait
> for post-release.

I'd feel more comfortable to take this in after release. Hopefully,
0.9.7 is going to be stable release (at least by features/bug fixes
ratio) even if this is a small and good looking patch.
> 
>  src/qemu/qemu_driver.c  |    2 +-
>  src/qemu/qemu_process.c |   35 ++++++++++++++++++++++++++++-------
>  src/qemu/qemu_process.h |    3 ++-
>  3 files changed, 31 insertions(+), 9 deletions(-)
> 

ACK

Michal




More information about the libvir-list mailing list