]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: update threading info about domain object refs
authorJonathon Jongsma <jjongsma@redhat.com>
Wed, 4 Sep 2019 17:23:30 +0000 (12:23 -0500)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 9 Sep 2019 11:01:09 +0000 (13:01 +0200)
Since commit fd9ef3b31e, virDomainFindByUUIDRef() no longer exists and
all virDomainObjListFindBy*() functions now increment the reference
count.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/qemu/THREADS.txt

index d17f3f4e0cce9439bf4f4232c889bac1641b1438..aa428fda6a0094fa42557f24e066e61c02d71cc7 100644 (file)
@@ -25,27 +25,17 @@ There are a number of locks on various objects
 
   * virDomainObjPtr
 
-    Will be locked after calling any of the virDomainObjListFindBy{ID,Name,UUID}
-    methods.  However, preferred method is qemuDomObjFromDomain() that uses
-    virDomainFindByUUIDRef() which also increases the reference counter and
-    finds the domain in the domain list without blocking all other lookups.
-    When the domain is locked and the reference increased, the preferred way of
-    decrementing the reference counter and unlocking the domain is using the
+    Will be locked and the reference counter will be increased after calling
+    any of the virDomainObjListFindBy{ID,Name,UUID} methods. The preferred way
+    of decrementing the reference counter and unlocking the domain is using the
     virDomainObjEndAPI() function.
 
     Lock must be held when changing/reading any variable in the virDomainObjPtr
 
-    If the lock needs to be dropped & then re-acquired for a short period of
-    time, the reference count must be incremented first using virDomainObjRef().
-    There is no need to increase the reference count if qemuDomObjFromDomain()
-    was used for looking up the domain.  In this case there is one reference
-    already added by that function.
-
     This lock must not be held for anything which sleeps/waits (i.e. monitor
     commands).
 
 
-
   * qemuMonitorPrivatePtr: Job conditions
 
     Since virDomainObjPtr lock must not be held during sleeps, the job