[libvirt] [PATCH] Add migration APIs for libxl driver

Eric Blake eblake at redhat.com
Fri Mar 16 18:53:53 UTC 2012


On 03/16/2012 11:53 AM, Jim Fehlig wrote:

> 
> Question for other libvirt devs:
> 
> Many of the libxl driver functions use this pattern
>  - lock driver
>  - vm = virDomainFindByUUID // acquires dom obj lock
>  - unlock driver
>  - do stuff
> - virDomainObjUnlock
> 
> In some cases, "do stuff" requires obtaining the driver lock (e.g.
> removing a domain from driver's domain list), in which case there is
> potential for deadlock.  Any suggestions for preventing the deadlock
> *and* avoiding locking the driver during long running operations?

See src/qemu/THREADS.txt.  That gives the details on how to drop the
driver lock and even the domain object lock, by maintaining a reference
count and job condition on each domain to ensure that others can still
use the driver, just not for the domain whose job is still occupied.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120316/c976ec51/attachment-0001.sig>


More information about the libvir-list mailing list