diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-08-20 22:09:37 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-08-20 23:01:08 -0500 |
commit | 7267c0947d7e8ae5dff7bafd932c3bc285f43e5c (patch) | |
tree | 9aa05d6e05ed83e67bf014f6745a3081b8407dc5 /blockdev.c | |
parent | 14015304b662e8f8ccce46c5a6927af6a14c510b (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 'blockdev.c')
-rw-r--r-- | blockdev.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/blockdev.c b/blockdev.c index a25367a9e3..d272659ab2 100644 --- a/blockdev.c +++ b/blockdev.c @@ -182,9 +182,9 @@ static void drive_uninit(DriveInfo *dinfo) { qemu_opts_del(dinfo->opts); bdrv_delete(dinfo->bdrv); - qemu_free(dinfo->id); + g_free(dinfo->id); QTAILQ_REMOVE(&drives, dinfo, next); - qemu_free(dinfo); + g_free(dinfo); } void drive_put_ref(DriveInfo *dinfo) @@ -442,12 +442,12 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi) /* init */ - dinfo = qemu_mallocz(sizeof(*dinfo)); + dinfo = g_malloc0(sizeof(*dinfo)); if ((buf = qemu_opts_id(opts)) != NULL) { - dinfo->id = qemu_strdup(buf); + dinfo->id = g_strdup(buf); } else { /* no id supplied -> create one */ - dinfo->id = qemu_mallocz(32); + dinfo->id = g_malloc0(32); if (type == IF_IDE || type == IF_SCSI) mediastr = (media == MEDIA_CDROM) ? "-cd" : "-hd"; if (max_devs) @@ -542,9 +542,9 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi) err: bdrv_delete(dinfo->bdrv); - qemu_free(dinfo->id); + g_free(dinfo->id); QTAILQ_REMOVE(&drives, dinfo, next); - qemu_free(dinfo); + g_free(dinfo); return NULL; } |