summaryrefslogtreecommitdiff
path: root/ui/spice-core.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-08-20 22:09:37 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-20 23:01:08 -0500
commit7267c0947d7e8ae5dff7bafd932c3bc285f43e5c (patch)
tree9aa05d6e05ed83e67bf014f6745a3081b8407dc5 /ui/spice-core.c
parent14015304b662e8f8ccce46c5a6927af6a14c510b (diff)
downloadqemu-7267c0947d7e8ae5dff7bafd932c3bc285f43e5c.tar.gz
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'ui/spice-core.c')
-rw-r--r--ui/spice-core.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/ui/spice-core.c b/ui/spice-core.c
index 8bb62eaa01..dba11f0c33 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -54,7 +54,7 @@ static SpiceTimer *timer_add(SpiceTimerFunc func, void *opaque)
{
SpiceTimer *timer;
- timer = qemu_mallocz(sizeof(*timer));
+ timer = g_malloc0(sizeof(*timer));
timer->timer = qemu_new_timer_ms(rt_clock, func, opaque);
QTAILQ_INSERT_TAIL(&timers, timer, next);
return timer;
@@ -75,7 +75,7 @@ static void timer_remove(SpiceTimer *timer)
qemu_del_timer(timer->timer);
qemu_free_timer(timer->timer);
QTAILQ_REMOVE(&timers, timer, next);
- qemu_free(timer);
+ g_free(timer);
}
struct SpiceWatch {
@@ -118,7 +118,7 @@ static SpiceWatch *watch_add(int fd, int event_mask, SpiceWatchFunc func, void *
{
SpiceWatch *watch;
- watch = qemu_mallocz(sizeof(*watch));
+ watch = g_malloc0(sizeof(*watch));
watch->fd = fd;
watch->func = func;
watch->opaque = opaque;
@@ -132,7 +132,7 @@ static void watch_remove(SpiceWatch *watch)
{
watch_update_mask(watch, 0);
QTAILQ_REMOVE(&watches, watch, next);
- qemu_free(watch);
+ g_free(watch);
}
#if SPICE_INTERFACE_CORE_MINOR >= 3
@@ -148,7 +148,7 @@ static void channel_list_add(SpiceChannelEventInfo *info)
{
ChannelList *item;
- item = qemu_mallocz(sizeof(*item));
+ item = g_malloc0(sizeof(*item));
item->info = info;
QTAILQ_INSERT_TAIL(&channel_list, item, link);
}
@@ -162,7 +162,7 @@ static void channel_list_del(SpiceChannelEventInfo *info)
continue;
}
QTAILQ_REMOVE(&channel_list, item, link);
- qemu_free(item);
+ g_free(item);
return;
}
}
@@ -510,25 +510,25 @@ void qemu_spice_init(void)
str = qemu_opt_get(opts, "x509-key-file");
if (str) {
- x509_key_file = qemu_strdup(str);
+ x509_key_file = g_strdup(str);
} else {
- x509_key_file = qemu_malloc(len);
+ x509_key_file = g_malloc(len);
snprintf(x509_key_file, len, "%s/%s", x509_dir, X509_SERVER_KEY_FILE);
}
str = qemu_opt_get(opts, "x509-cert-file");
if (str) {
- x509_cert_file = qemu_strdup(str);
+ x509_cert_file = g_strdup(str);
} else {
- x509_cert_file = qemu_malloc(len);
+ x509_cert_file = g_malloc(len);
snprintf(x509_cert_file, len, "%s/%s", x509_dir, X509_SERVER_CERT_FILE);
}
str = qemu_opt_get(opts, "x509-cacert-file");
if (str) {
- x509_cacert_file = qemu_strdup(str);
+ x509_cacert_file = g_strdup(str);
} else {
- x509_cacert_file = qemu_malloc(len);
+ x509_cacert_file = g_malloc(len);
snprintf(x509_cacert_file, len, "%s/%s", x509_dir, X509_CA_CERT_FILE);
}
@@ -631,9 +631,9 @@ void qemu_spice_init(void)
qemu_spice_input_init();
qemu_spice_audio_init();
- qemu_free(x509_key_file);
- qemu_free(x509_cert_file);
- qemu_free(x509_cacert_file);
+ g_free(x509_key_file);
+ g_free(x509_cert_file);
+ g_free(x509_cacert_file);
}
int qemu_spice_add_interface(SpiceBaseInstance *sin)