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>
This commit is contained in:
Anthony Liguori 2011-08-20 22:09:37 -05:00
parent 14015304b6
commit 7267c0947d
357 changed files with 1672 additions and 1674 deletions

View file

@ -310,7 +310,7 @@ static int curl_open(BlockDriverState *bs, const char *filename, int flags)
static int inited = 0;
file = qemu_strdup(filename);
file = g_strdup(filename);
s->readahead_size = READ_AHEAD_SIZE;
/* Parse a trailing ":readahead=#:" param, if present. */
@ -390,7 +390,7 @@ out:
curl_easy_cleanup(state->curl);
state->curl = NULL;
out_noclean:
qemu_free(file);
g_free(file);
return -EINVAL;
}
@ -444,11 +444,11 @@ static BlockDriverAIOCB *curl_aio_readv(BlockDriverState *bs,
state->buf_off = 0;
if (state->orig_buf)
qemu_free(state->orig_buf);
g_free(state->orig_buf);
state->buf_start = start;
state->buf_len = acb->end + s->readahead_size;
end = MIN(start + state->buf_len, s->len) - 1;
state->orig_buf = qemu_malloc(state->buf_len);
state->orig_buf = g_malloc(state->buf_len);
state->acb[0] = acb;
snprintf(state->range, 127, "%zd-%zd", start, end);
@ -476,7 +476,7 @@ static void curl_close(BlockDriverState *bs)
s->states[i].curl = NULL;
}
if (s->states[i].orig_buf) {
qemu_free(s->states[i].orig_buf);
g_free(s->states[i].orig_buf);
s->states[i].orig_buf = NULL;
}
}