From f44992e77e45044ac26fc02e18bca6efefbef63f Mon Sep 17 00:00:00 2001
Message-Id: <f44992e77e45044ac26fc02e18bca6efefbef63f.1342518105.git.minovotn@redhat.com>
In-Reply-To: <27a73856ecc481c66c7afac8171f753887f32e31.1342518105.git.minovotn@redhat.com>
References: <27a73856ecc481c66c7afac8171f753887f32e31.1342518105.git.minovotn@redhat.com>
From: Luiz Capitulino <lcapitulino@redhat.com>
Date: Tue, 5 Jun 2012 14:58:29 +0200
Subject: [PATCH 20/41] qemu-ga: guest_fsfreeze_build_mount_list(): use
 g_malloc()/g_free()

RH-Author: Luiz Capitulino <lcapitulino@redhat.com>
Message-id: <1338908331-15633-15-git-send-email-lcapitulino@redhat.com>
Patchwork-id: 39911
O-Subject: [PATCH RHEL6.4 qemu-kvm 14/36] qemu-ga: guest_fsfreeze_build_mount_list(): use g_malloc()/g_free()
Bugzilla: 827612
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
RH-Acked-by: Juan Quintela <quintela@redhat.com>
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>

The allocated data is only used internally by the fsfreeze functions,
so let's use g_malloc()/g_free() instead of qemu_malloc()/qemu_free(),
as doing this will save us a few conflicts when backporting patches.

This is a RHEL-only commit.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 qga/commands-posix.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Signed-off-by: Michal Novotny <minovotn@redhat.com>
---
 qga/commands-posix.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 9982557..ce08284 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -384,9 +384,9 @@ static int guest_fsfreeze_build_mount_list(void)
 
     QTAILQ_FOREACH_SAFE(mount, &guest_fsfreeze_state.mount_list, next, temp) {
         QTAILQ_REMOVE(&guest_fsfreeze_state.mount_list, mount, next);
-        qemu_free(mount->dirname);
-        qemu_free(mount->devtype);
-        qemu_free(mount);
+        g_free(mount->dirname);
+        g_free(mount->devtype);
+        g_free(mount);
     }
 
     fp = setmntent(mtab, "r");
@@ -408,9 +408,9 @@ static int guest_fsfreeze_build_mount_list(void)
             continue;
         }
 
-        mount = qemu_mallocz(sizeof(GuestFsfreezeMount));
-        mount->dirname = qemu_strdup(ment->mnt_dir);
-        mount->devtype = qemu_strdup(ment->mnt_type);
+        mount = g_malloc0(sizeof(GuestFsfreezeMount));
+        mount->dirname = g_strdup(ment->mnt_dir);
+        mount->devtype = g_strdup(ment->mnt_type);
 
         QTAILQ_INSERT_TAIL(&guest_fsfreeze_state.mount_list, mount, next);
     }
-- 
1.7.10.4

