Signed-off-by: Rafael Fonseca <r4f4rfs(a)gmail.com>
---
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