[PATCH 22/43] vmware: convert virMutex to GMutex

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

 



Signed-off-by: Rafael Fonseca <r4f4rfs@xxxxxxxxx>
---
 src/vmware/vmware_conf.c   | 2 +-
 src/vmware/vmware_conf.h   | 2 +-
 src/vmware/vmware_driver.c | 7 +++----
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c
index fd62bb96f7..dbe67fcd97 100644
--- a/src/vmware/vmware_conf.c
+++ b/src/vmware/vmware_conf.c
@@ -52,7 +52,7 @@ vmwareFreeDriver(struct vmware_driver *driver)
     if (!driver)
         return;
 
-    virMutexDestroy(&driver->lock);
+    g_mutex_clear(&driver->lock);
     virObjectUnref(driver->domains);
     virObjectUnref(driver->caps);
     virObjectUnref(driver->xmlopt);
diff --git a/src/vmware/vmware_conf.h b/src/vmware/vmware_conf.h
index 5e0ef3744f..11610c1fcb 100644
--- a/src/vmware/vmware_conf.h
+++ b/src/vmware/vmware_conf.h
@@ -41,7 +41,7 @@ enum vmwareDriverType {
 VIR_ENUM_DECL(vmwareDriver);
 
 struct vmware_driver {
-    virMutex lock;
+    GMutex lock;
     virCapsPtr caps;
     virDomainXMLOptionPtr xmlopt;
 
diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c
index d5dd6e4f5e..986615a515 100644
--- a/src/vmware/vmware_driver.c
+++ b/src/vmware/vmware_driver.c
@@ -50,13 +50,13 @@ static const char * const vmrun_candidates[] = {
 static void
 vmwareDriverLock(struct vmware_driver *driver)
 {
-    virMutexLock(&driver->lock);
+    g_mutex_lock(&driver->lock);
 }
 
 static void
 vmwareDriverUnlock(struct vmware_driver *driver)
 {
-    virMutexUnlock(&driver->lock);
+    g_mutex_unlock(&driver->lock);
 }
 
 
@@ -211,8 +211,7 @@ vmwareConnectOpen(virConnectPtr conn,
         goto cleanup;
     }
 
-    if (virMutexInit(&driver->lock) < 0)
-        goto cleanup;
+    g_mutex_init(&driver->lock);
 
     if ((tmp = STRSKIP(conn->uri->scheme, "vmware")) == NULL) {
         virReportError(VIR_ERR_INTERNAL_ERROR, _("unable to parse URI "
-- 
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