[libvirt] [PATCH 11/15] Release driver and domain lock when running monitor commands

Daniel Veillard veillard at redhat.com
Wed Nov 4 17:31:02 UTC 2009


On Tue, Nov 03, 2009 at 02:50:05PM -0500, Daniel P. Berrange wrote:
> QEMU monitor commands may sleep for a prolonged period of time.
> If the virDomainObjPtr or qemu driver lock is held this will
> needlessly block execution of many other API calls. it also
> prevents asynchronous monitor events from being dispatched
> while a monitor command is executing, because deadlock will
> ensure.
> 
> To resolve this, it is neccessary to release all locks while
> executing a monitor command. This change introduces a flag
> indicating that a monitor job is active, and a condition
> variable to synchronize access to this flag. This ensures that
> only a single thread can be making a state change or executing
> a monitor command at a time, while still allowing other API
> calls to be completed without blocking
> 
> * src/qemu/qemu_driver.c: Release driver and domain lock when
>   running monitor commands
> * src/qemu/THREADS.txt: Document threading rules

  ACK, I don't understand everything by far but looks fine.

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/




More information about the libvir-list mailing list