]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Introduce annotations for virLXCDriverPtr fields
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 16 Jul 2013 17:20:24 +0000 (19:20 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 18 Jul 2013 12:16:54 +0000 (14:16 +0200)
Annotate the fields in virLXCDriverPtr to indicate the locking
rules for their use.

src/lxc/lxc_conf.h

index d935064aa82a141efefd8095b310f1ce9e9aa913..089ba4e2a0db54949410d660050d7ba8a1f29398 100644 (file)
@@ -67,30 +67,44 @@ struct _virLXCDriverConfig {
 struct _virLXCDriver {
     virMutex lock;
 
+    /* Require lock to get reference on 'config',
+     * then lockless thereafter */
     virLXCDriverConfigPtr config;
 
+    /* Require lock while using. Unsafe. XXX */
     virCapsPtr caps;
 
+
+    /* Immutable pointer, Immutable object */
     virDomainXMLOptionPtr xmlopt;
 
+    /* Immutable pointer, lockless APIs*/
     virSysinfoDefPtr hostsysinfo;
 
+    /* Atomic inc/dec only */
     unsigned int nactive;
 
+    /* Immutable pointers. Caller must provide locking */
     virStateInhibitCallback inhibitCallback;
     void *inhibitOpaque;
 
+    /* Immutable pointer, self-locking APIs */
     virDomainObjListPtr domains;
 
+    /* Immutable pointer. Requires lock to be held before
+     * calling APIs. */
     virUSBDeviceListPtr activeUsbHostdevs;
 
+    /* Immutable pointer, self-locking APIs */
     virDomainEventStatePtr domainEventState;
 
+    /* Immutable pointer. self-locking APIs */
     virSecurityManagerPtr securityManager;
 
     /* Mapping of 'char *uuidstr' -> virConnectPtr
      * of guests which will be automatically killed
-     * when the virConnectPtr is closed*/
+     * when the virConnectPtr is closed.
+     * Immutable pointer. Unsafe APIs. XXX */
     virHashTablePtr autodestroy;
 };