[libvirt] [PATCH 1/2] qemu: Add missing lock of virDomainObj before calling virDomainUnref

Eric Blake eblake at redhat.com
Mon Mar 7 14:16:58 UTC 2011


On 03/07/2011 03:03 AM, Daniel P. Berrange wrote:
>> I think the real reason for the deadlock is that:
>>
>> qemudDomainSaveFlag holds the domain lock while it calls
>> qemuDomainEventQueue, which requests the event loop lock
>>
>> the event loop thread holds the event loop lock, and can make several
>> different callbacks that can result in requesting a domain lock
> 
> I don't think this can be the deadlock scenario. The event loop lock
> is completely isolated from other locks, because it is only ever held
> while code in event.c is executing. It is always released when invoking
> any external callbacks, so you can't have any lock ordering dependencies
> wrt the event loop lock.

But right now, the event loop lock _is_ held while calling the destroy
callbacks; see virEventCleanupHandles.  Would it be better to break the
deadlock by dropping the event loop lock there?

Oh, serves me right for reading email in order; I just noticed that this
has been suggested already:
https://www.redhat.com/archives/libvir-list/2011-March/msg00218.html
https://www.redhat.com/archives/libvir-list/2011-March/msg00232.html

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

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


More information about the libvir-list mailing list