summaryrefslogtreecommitdiff
path: root/hw/ivshmem.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 /hw/ivshmem.c
parent14015304b662e8f8ccce46c5a6927af6a14c510b (diff)
downloadqemu-7267c0947d7e8ae5dff7bafd932c3bc285f43e5c.zip
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 'hw/ivshmem.c')
-rw-r--r--hw/ivshmem.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/hw/ivshmem.c b/hw/ivshmem.c
index 42a5877032..f4ae0d2b95 100644
--- a/hw/ivshmem.c
+++ b/hw/ivshmem.c
@@ -351,7 +351,7 @@ static void close_guest_eventfds(IVShmemState *s, int posn)
close(s->peers[posn].eventfds[i]);
}
- qemu_free(s->peers[posn].eventfds);
+ g_free(s->peers[posn].eventfds);
s->peers[posn].nb_eventfds = 0;
}
@@ -383,7 +383,7 @@ static void increase_dynamic_storage(IVShmemState *s, int new_min_size) {
s->nb_peers = s->nb_peers * 2;
IVSHMEM_DPRINTF("bumping storage to %d guests\n", s->nb_peers);
- s->peers = qemu_realloc(s->peers, s->nb_peers * sizeof(Peer));
+ s->peers = g_realloc(s->peers, s->nb_peers * sizeof(Peer));
/* zero out new pointers */
for (j = old_nb_alloc; j < s->nb_peers; j++) {
@@ -467,7 +467,7 @@ static void ivshmem_read(void *opaque, const uint8_t * buf, int flags)
if (guest_max_eventfd == 0) {
/* one eventfd per MSI vector */
- s->peers[incoming_posn].eventfds = (int *) qemu_malloc(s->vectors *
+ s->peers[incoming_posn].eventfds = (int *) g_malloc(s->vectors *
sizeof(int));
}
@@ -557,7 +557,7 @@ static void ivshmem_setup_msi(IVShmemState * s) {
}
/* allocate Qemu char devices for receiving interrupts */
- s->eventfd_table = qemu_mallocz(s->vectors * sizeof(EventfdEntry));
+ s->eventfd_table = g_malloc0(s->vectors * sizeof(EventfdEntry));
}
static void ivshmem_save(QEMUFile* f, void *opaque)
@@ -691,12 +691,12 @@ static int pci_ivshmem_init(PCIDevice *dev)
s->vm_id = -1;
/* allocate/initialize space for interrupt handling */
- s->peers = qemu_mallocz(s->nb_peers * sizeof(Peer));
+ s->peers = g_malloc0(s->nb_peers * sizeof(Peer));
pci_register_bar(&s->dev, 2,
PCI_BASE_ADDRESS_SPACE_MEMORY, &s->ivshmem);
- s->eventfd_chr = qemu_mallocz(s->vectors * sizeof(CharDriverState *));
+ s->eventfd_chr = g_malloc0(s->vectors * sizeof(CharDriverState *));
qemu_chr_add_handlers(s->server_chr, ivshmem_can_receive, ivshmem_read,
ivshmem_event, s);