Annotate the fields in virLXCDriverPtr to indicate the locking
rules for their use
---
src/lxc/lxc_conf.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/lxc/lxc_conf.h b/src/lxc/lxc_conf.h
index f9a3e53..831e3e5 100644
--- a/src/lxc/lxc_conf.h
+++ b/src/lxc/lxc_conf.h
@@ -67,29 +67,43 @@ 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. Unsafe APIs XXX */
virCgroupPtr cgroup;
+ /* 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;
+ /* Immutable pointer. Unsafe APIs. XXX */
virHashTablePtr autodestroy;
};
--
1.8.1.5