aboutsummaryrefslogtreecommitdiff
path: root/hw/ide
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/ide
parent14015304b662e8f8ccce46c5a6927af6a14c510b (diff)
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/ide')
-rw-r--r--hw/ide/ahci.c4
-rw-r--r--hw/ide/macio.c2
-rw-r--r--hw/ide/microdrive.c4
-rw-r--r--hw/ide/mmio.c2
-rw-r--r--hw/ide/qdev.c4
5 files changed, 8 insertions, 8 deletions
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,