[libvirt] [PATCH v3 11/15] struct _virNetworkDriverState: Annotate items

Peter Krempa pkrempa at redhat.com
Wed Mar 11 13:44:29 UTC 2015


On Tue, Mar 10, 2015 at 17:45:17 +0100, Michal Privoznik wrote:
> In order to drop network driver lock, lets annotate which
> structure items are immutable, which have self-locking
> APIs and so on.
> 
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
>  src/network/bridge_driver_platform.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/network/bridge_driver_platform.h b/src/network/bridge_driver_platform.h
> index b7492e6..d9cf6a8 100644
> --- a/src/network/bridge_driver_platform.h
> +++ b/src/network/bridge_driver_platform.h
> @@ -34,8 +34,10 @@
>  struct _virNetworkDriverState {
>      virMutex lock;
>  
> +    /* Immutable pointer, self-locking APIs */
>      virNetworkObjListPtr networks;
>  
> +    /* Immutable pointer, Immutable objects */
>      char *networkConfigDir;
>      char *networkAutostartDir;
>      char *stateDir;
> @@ -44,6 +46,7 @@ struct _virNetworkDriverState {
>      char *radvdStateDir;
>      dnsmasqCapsPtr dnsmasqCaps;

Unfortunately dnsmasqCaps is not immutable. In networkStartDhcpDaemon
it's re-allocated or updated when the network is started.

>  
> +    /* Immutable pointer, self-locking APIs */
>      virObjectEventStatePtr networkEventState;
>  };

ACK if you notify that @dnsmasqCaps is not immutable.

Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150311/fb18b7c6/attachment-0001.sig>


More information about the libvir-list mailing list