From 4deeb74d01adfe1d0d36914785ba24ad7f74060e Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Tue, 16 Jul 2013 19:20:24 +0200 Subject: [PATCH] Introduce annotations for virLXCDriverPtr fields Annotate the fields in virLXCDriverPtr to indicate the locking rules for their use. --- src/lxc/lxc_conf.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/lxc/lxc_conf.h b/src/lxc/lxc_conf.h index d935064aa8..089ba4e2a0 100644 --- a/src/lxc/lxc_conf.h +++ b/src/lxc/lxc_conf.h @@ -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; }; -- 2.47.2