Re: [PATCH 4/9] Introduce annotations for virLXCDriverPtr fields

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 17, 2013 at 03:04:21PM +0200, Michal Privoznik wrote:
> 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;

Oh this field is completely unused & should have been deleted a
while back. Please just kill as a separate patch.

>  
> +    /* 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;
>  };

ACK, all makes sense.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]