mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-31 22:11:53 -06: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:
parent
14015304b6
commit
7267c0947d
357 changed files with 1672 additions and 1674 deletions
|
@ -66,7 +66,7 @@ static void scsi_free_request(SCSIRequest *req)
|
|||
{
|
||||
SCSIGenericReq *r = DO_UPCAST(SCSIGenericReq, req, req);
|
||||
|
||||
qemu_free(r->buf);
|
||||
g_free(r->buf);
|
||||
}
|
||||
|
||||
/* Helper function for command completion. */
|
||||
|
@ -288,7 +288,7 @@ static int32_t scsi_send_command(SCSIRequest *req, uint8_t *cmd)
|
|||
|
||||
if (r->req.cmd.xfer == 0) {
|
||||
if (r->buf != NULL)
|
||||
qemu_free(r->buf);
|
||||
g_free(r->buf);
|
||||
r->buflen = 0;
|
||||
r->buf = NULL;
|
||||
ret = execute_command(s->bs, r, SG_DXFER_NONE, scsi_command_complete);
|
||||
|
@ -301,8 +301,8 @@ static int32_t scsi_send_command(SCSIRequest *req, uint8_t *cmd)
|
|||
|
||||
if (r->buflen != r->req.cmd.xfer) {
|
||||
if (r->buf != NULL)
|
||||
qemu_free(r->buf);
|
||||
r->buf = qemu_malloc(r->req.cmd.xfer);
|
||||
g_free(r->buf);
|
||||
r->buf = g_malloc(r->req.cmd.xfer);
|
||||
r->buflen = r->req.cmd.xfer;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue