Re: [PATCH 20/43] network: bridge_driver: convert virMutex to GMutex

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

 



On Fri, Apr 10, 2020 at 03:54:47PM +0200, Rafael Fonseca wrote:
> Signed-off-by: Rafael Fonseca <r4f4rfs@xxxxxxxxx>
> ---
>  src/network/bridge_driver.c          | 11 ++++-------
>  src/network/bridge_driver_platform.h |  2 +-
>  2 files changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
> index f06099297a..2eaab9c667 100644
> --- a/src/network/bridge_driver.c
> +++ b/src/network/bridge_driver.c
> @@ -101,14 +101,14 @@ networkGetDriver(void)
>  static void
>  networkDriverLock(virNetworkDriverStatePtr driver)
>  {
> -    virMutexLock(&driver->lock);
> +    g_mutex_lock(&driver->lock);
>  }
>  
>  
>  static void
>  networkDriverUnlock(virNetworkDriverStatePtr driver)
>  {
> -    virMutexUnlock(&driver->lock);
> +    g_mutex_unlock(&driver->lock);
>  }
>  
>  
> @@ -726,10 +726,7 @@ networkStateInitialize(bool privileged,
>          goto error;
>  
>      network_driver->lockFD = -1;
> -    if (virMutexInit(&network_driver->lock) < 0) {
> -        VIR_FREE(network_driver);
> -        goto error;
> -    }
> +    g_mutex_init(&network_driver->lock);
>  
>      network_driver->privileged = privileged;
>  
> @@ -907,7 +904,7 @@ networkStateCleanup(void)
>  
>      virObjectUnref(network_driver->dnsmasqCaps);
>  
> -    virMutexDestroy(&network_driver->lock);
> +    g_mutex_clear(&network_driver->lock);
>  
>      VIR_FREE(network_driver);
>  
> diff --git a/src/network/bridge_driver_platform.h b/src/network/bridge_driver_platform.h
> index 169417a6c0..6528bf6647 100644
> --- a/src/network/bridge_driver_platform.h
> +++ b/src/network/bridge_driver_platform.h
> @@ -29,7 +29,7 @@
>  
>  /* Main driver state */
>  struct _virNetworkDriverState {
> -    virMutex lock;
> +    GMutex lock;
>  
>      /* Read-only */
>      bool privileged;
> -- 
> 2.25.2
> 
> 

Reviewed-by: Pavel Mores <pmores@xxxxxxxxxx>





[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]

  Powered by Linux