mirror of
https://github.com/mii443/qemu.git
synced 2025-08-27 17:39:37 +00:00
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:
10
block/curl.c
10
block/curl.c
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user