[PATCH 35/43] util: virnetdevveth: convert virMutex to GMutex

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

 



Signed-off-by: Rafael Fonseca <r4f4rfs@xxxxxxxxx>
---
 src/util/virnetdevveth.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/util/virnetdevveth.c b/src/util/virnetdevveth.c
index b3eee1afce..d1fc4c372d 100644
--- a/src/util/virnetdevveth.c
+++ b/src/util/virnetdevveth.c
@@ -34,7 +34,7 @@ VIR_LOG_INIT("util.netdevveth");
 
 /* Functions */
 
-virMutex virNetDevVethCreateMutex = VIR_MUTEX_INITIALIZER;
+G_LOCK_DEFINE(virNetDevVethCreateMutex);
 
 static int virNetDevVethExists(int devNum)
 {
@@ -110,7 +110,7 @@ int virNetDevVethCreate(char** veth1, char** veth2)
      * We might race with other containers, but this is reasonably
      * unlikely, so don't do too many retries for device creation
      */
-    virMutexLock(&virNetDevVethCreateMutex);
+    G_LOCK(virNetDevVethCreateMutex);
 #define MAX_VETH_RETRIES 10
 
     for (i = 0; i < MAX_VETH_RETRIES; i++) {
@@ -171,7 +171,7 @@ int virNetDevVethCreate(char** veth1, char** veth2)
                    MAX_VETH_RETRIES);
 
  cleanup:
-    virMutexUnlock(&virNetDevVethCreateMutex);
+    G_UNLOCK(virNetDevVethCreateMutex);
     return ret;
 }
 
-- 
2.25.2






[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