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 /qemu-img.c | |
parent | 14015304b662e8f8ccce46c5a6927af6a14c510b (diff) | |
download | qemu-7267c0947d7e8ae5dff7bafd932c3bc285f43e5c.tar.gz qemu-7267c0947d7e8ae5dff7bafd932c3bc285f43e5c.tar.bz2 qemu-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 'qemu-img.c')
-rw-r--r-- | qemu-img.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/qemu-img.c b/qemu-img.c index b205e98dd2..95f3219571 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -713,7 +713,7 @@ static int img_convert(int argc, char **argv) qemu_progress_init(progress, 2.0); qemu_progress_print(0, 100); - bs = qemu_mallocz(bs_n * sizeof(BlockDriverState *)); + bs = g_malloc0(bs_n * sizeof(BlockDriverState *)); total_sectors = 0; for (bs_i = 0; bs_i < bs_n; bs_i++) { @@ -834,7 +834,7 @@ static int img_convert(int argc, char **argv) bs_i = 0; bs_offset = 0; bdrv_get_geometry(bs[0], &bs_sectors); - buf = qemu_malloc(IO_BUF_SIZE); + buf = g_malloc(IO_BUF_SIZE); if (compress) { ret = bdrv_get_info(out_bs, &bdi); @@ -1006,7 +1006,7 @@ out: qemu_progress_end(); free_option_parameters(create_options); free_option_parameters(param); - qemu_free(buf); + g_free(buf); if (out_bs) { bdrv_delete(out_bs); } @@ -1016,7 +1016,7 @@ out: bdrv_delete(bs[bs_i]); } } - qemu_free(bs); + g_free(bs); } if (ret) { return 1; @@ -1040,7 +1040,7 @@ static void dump_snapshots(BlockDriverState *bs) sn = &sn_tab[i]; printf("%s\n", bdrv_snapshot_dump(buf, sizeof(buf), sn)); } - qemu_free(sn_tab); + g_free(sn_tab); } static int img_info(int argc, char **argv) @@ -1373,8 +1373,8 @@ static int img_rebase(int argc, char **argv) uint8_t * buf_new; float local_progress; - buf_old = qemu_malloc(IO_BUF_SIZE); - buf_new = qemu_malloc(IO_BUF_SIZE); + buf_old = g_malloc(IO_BUF_SIZE); + buf_new = g_malloc(IO_BUF_SIZE); bdrv_get_geometry(bs, &num_sectors); @@ -1430,8 +1430,8 @@ static int img_rebase(int argc, char **argv) qemu_progress_print(local_progress, 100); } - qemu_free(buf_old); - qemu_free(buf_new); + g_free(buf_old); + g_free(buf_new); } /* |