From 7267c0947d7e8ae5dff7bafd932c3bc285f43e5c Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Sat, 20 Aug 2011 22:09:37 -0500 Subject: Use glib memory allocation and free functions qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori --- hw/ide/ahci.c | 4 ++-- hw/ide/macio.c | 2 +- hw/ide/microdrive.c | 4 ++-- hw/ide/mmio.c | 2 +- hw/ide/qdev.c | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) (limited to 'hw/ide') diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index e207ca0894..29521babf7 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -1123,7 +1123,7 @@ void ahci_init(AHCIState *s, DeviceState *qdev, int ports) int i; s->ports = ports; - s->dev = qemu_mallocz(sizeof(AHCIDevice) * ports); + s->dev = g_malloc0(sizeof(AHCIDevice) * ports); ahci_reg_init(s); /* XXX BAR size should be 1k, but that breaks, so bump it to 4k for now */ memory_region_init_io(&s->mem, &ahci_mem_ops, s, "ahci", 0x1000); @@ -1146,7 +1146,7 @@ void ahci_init(AHCIState *s, DeviceState *qdev, int ports) void ahci_uninit(AHCIState *s) { memory_region_destroy(&s->mem); - qemu_free(s->dev); + g_free(s->dev); } void ahci_reset(void *opaque) diff --git a/hw/ide/macio.c b/hw/ide/macio.c index 7ee35e9bd9..44fb3fef60 100644 --- a/hw/ide/macio.c +++ b/hw/ide/macio.c @@ -325,7 +325,7 @@ MemoryRegion *pmac_ide_init (DriveInfo **hd_table, qemu_irq irq, { MACIOIDEState *d; - d = qemu_mallocz(sizeof(MACIOIDEState)); + d = g_malloc0(sizeof(MACIOIDEState)); ide_init2_with_non_qdev_drives(&d->bus, hd_table[0], hd_table[1], irq); if (dbdma) diff --git a/hw/ide/microdrive.c b/hw/ide/microdrive.c index 9fbbf0e78a..91c0e3c89d 100644 --- a/hw/ide/microdrive.c +++ b/hw/ide/microdrive.c @@ -531,7 +531,7 @@ static int dscm1xxxx_detach(void *opaque) PCMCIACardState *dscm1xxxx_init(DriveInfo *bdrv) { - MicroDriveState *md = (MicroDriveState *) qemu_mallocz(sizeof(MicroDriveState)); + MicroDriveState *md = (MicroDriveState *) g_malloc0(sizeof(MicroDriveState)); md->card.state = md; md->card.attach = dscm1xxxx_attach; md->card.detach = dscm1xxxx_detach; @@ -542,7 +542,7 @@ PCMCIACardState *dscm1xxxx_init(DriveInfo *bdrv) qemu_allocate_irqs(md_set_irq, md, 1)[0]); md->bus.ifs[0].drive_kind = IDE_CFATA; md->bus.ifs[0].mdata_size = METADATA_SIZE; - md->bus.ifs[0].mdata_storage = (uint8_t *) qemu_mallocz(METADATA_SIZE); + md->bus.ifs[0].mdata_storage = (uint8_t *) g_malloc0(METADATA_SIZE); vmstate_register(NULL, -1, &vmstate_microdrive, md); diff --git a/hw/ide/mmio.c b/hw/ide/mmio.c index 10f6f4063c..132b7517ba 100644 --- a/hw/ide/mmio.c +++ b/hw/ide/mmio.c @@ -121,7 +121,7 @@ void mmio_ide_init (target_phys_addr_t membase, target_phys_addr_t membase2, qemu_irq irq, int shift, DriveInfo *hd0, DriveInfo *hd1) { - MMIOState *s = qemu_mallocz(sizeof(MMIOState)); + MMIOState *s = g_malloc0(sizeof(MMIOState)); int mem1, mem2; ide_init2_with_non_qdev_drives(&s->bus, hd0, hd1, irq); diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c index 6bd8d20270..42071277bb 100644 --- a/hw/ide/qdev.c +++ b/hw/ide/qdev.c @@ -148,10 +148,10 @@ static int ide_dev_initfn(IDEDevice *dev, IDEDriveKind kind) } if (!dev->version) { - dev->version = qemu_strdup(s->version); + dev->version = g_strdup(s->version); } if (!dev->serial) { - dev->serial = qemu_strdup(s->drive_serial_str); + dev->serial = g_strdup(s->drive_serial_str); } add_boot_device_path(dev->conf.bootindex, &dev->qdev, -- cgit v1.2.1