aboutsummaryrefslogtreecommitdiff
path: root/net/queue.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 /net/queue.c
parent14015304b662e8f8ccce46c5a6927af6a14c510b (diff)
downloadqemu-7267c0947d7e8ae5dff7bafd932c3bc285f43e5c.zip
qemu-7267c0947d7e8ae5dff7bafd932c3bc285f43e5c.tar.gz
qemu-7267c0947d7e8ae5dff7bafd932c3bc285f43e5c.tar.bz2
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 'net/queue.c')
-rw-r--r--net/queue.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/queue.c b/net/queue.c
index 2ea6cd0..1ab5247 100644
--- a/net/queue.c
+++ b/net/queue.c
@@ -63,7 +63,7 @@ NetQueue *qemu_new_net_queue(NetPacketDeliver *deliver,
{
NetQueue *queue;
- queue = qemu_mallocz(sizeof(NetQueue));
+ queue = g_malloc0(sizeof(NetQueue));
queue->deliver = deliver;
queue->deliver_iov = deliver_iov;
@@ -82,10 +82,10 @@ void qemu_del_net_queue(NetQueue *queue)
QTAILQ_FOREACH_SAFE(packet, &queue->packets, entry, next) {
QTAILQ_REMOVE(&queue->packets, packet, entry);
- qemu_free(packet);
+ g_free(packet);
}
- qemu_free(queue);
+ g_free(queue);
}
static ssize_t qemu_net_queue_append(NetQueue *queue,
@@ -97,7 +97,7 @@ static ssize_t qemu_net_queue_append(NetQueue *queue,
{
NetPacket *packet;
- packet = qemu_malloc(sizeof(NetPacket) + size);
+ packet = g_malloc(sizeof(NetPacket) + size);
packet->sender = sender;
packet->flags = flags;
packet->size = size;
@@ -124,7 +124,7 @@ static ssize_t qemu_net_queue_append_iov(NetQueue *queue,
max_len += iov[i].iov_len;
}
- packet = qemu_malloc(sizeof(NetPacket) + max_len);
+ packet = g_malloc(sizeof(NetPacket) + max_len);
packet->sender = sender;
packet->sent_cb = sent_cb;
packet->flags = flags;
@@ -227,7 +227,7 @@ void qemu_net_queue_purge(NetQueue *queue, VLANClientState *from)
QTAILQ_FOREACH_SAFE(packet, &queue->packets, entry, next) {
if (packet->sender == from) {
QTAILQ_REMOVE(&queue->packets, packet, entry);
- qemu_free(packet);
+ g_free(packet);
}
}
}
@@ -255,6 +255,6 @@ void qemu_net_queue_flush(NetQueue *queue)
packet->sent_cb(packet->sender, ret);
}
- qemu_free(packet);
+ g_free(packet);
}
}