mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-07-31 05:57:16 +00:00
qemu: use glib allocation apis for qemuAgentFSInfo
Switch from old VIR_ allocation APIs to glib equivalents. Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
9e1a8298cd
commit
9a7d618c79
@ -1854,10 +1854,10 @@ qemuAgentDiskInfoFree(qemuAgentDiskInfoPtr info)
|
|||||||
if (!info)
|
if (!info)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
VIR_FREE(info->serial);
|
g_free(info->serial);
|
||||||
VIR_FREE(info->bus_type);
|
g_free(info->bus_type);
|
||||||
VIR_FREE(info->devnode);
|
g_free(info->devnode);
|
||||||
VIR_FREE(info);
|
g_free(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -1868,15 +1868,15 @@ qemuAgentFSInfoFree(qemuAgentFSInfoPtr info)
|
|||||||
if (!info)
|
if (!info)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
VIR_FREE(info->mountpoint);
|
g_free(info->mountpoint);
|
||||||
VIR_FREE(info->name);
|
g_free(info->name);
|
||||||
VIR_FREE(info->fstype);
|
g_free(info->fstype);
|
||||||
|
|
||||||
for (i = 0; i < info->ndisks; i++)
|
for (i = 0; i < info->ndisks; i++)
|
||||||
qemuAgentDiskInfoFree(info->disks[i]);
|
qemuAgentDiskInfoFree(info->disks[i]);
|
||||||
VIR_FREE(info->disks);
|
g_free(info->disks);
|
||||||
|
|
||||||
VIR_FREE(info);
|
g_free(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -1999,8 +1999,7 @@ qemuAgentGetFSInfo(qemuAgentPtr mon,
|
|||||||
*info = NULL;
|
*info = NULL;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
if (VIR_ALLOC_N(info_ret, ndata) < 0)
|
info_ret = g_new0(qemuAgentFSInfoPtr, ndata);
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
for (i = 0; i < ndata; i++) {
|
for (i = 0; i < ndata; i++) {
|
||||||
/* Reverse the order to arrange in mount order */
|
/* Reverse the order to arrange in mount order */
|
||||||
@ -2017,8 +2016,7 @@ qemuAgentGetFSInfo(qemuAgentPtr mon,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VIR_ALLOC(info_ret[i]) < 0)
|
info_ret[i] = g_new0(qemuAgentFSInfo, 1);
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
if (!(result = virJSONValueObjectGetString(entry, "mountpoint"))) {
|
if (!(result = virJSONValueObjectGetString(entry, "mountpoint"))) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
@ -2088,7 +2086,7 @@ qemuAgentGetFSInfo(qemuAgentPtr mon,
|
|||||||
if (info_ret) {
|
if (info_ret) {
|
||||||
for (i = 0; i < ndata; i++)
|
for (i = 0; i < ndata; i++)
|
||||||
qemuAgentFSInfoFree(info_ret[i]);
|
qemuAgentFSInfoFree(info_ret[i]);
|
||||||
VIR_FREE(info_ret);
|
g_free(info_ret);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -23246,7 +23246,7 @@ qemuDomainGetGuestInfo(virDomainPtr dom,
|
|||||||
cleanup:
|
cleanup:
|
||||||
for (i = 0; i < nfs; i++)
|
for (i = 0; i < nfs; i++)
|
||||||
qemuAgentFSInfoFree(agentfsinfo[i]);
|
qemuAgentFSInfoFree(agentfsinfo[i]);
|
||||||
VIR_FREE(agentfsinfo);
|
g_free(agentfsinfo);
|
||||||
|
|
||||||
virDomainObjEndAPI(&vm);
|
virDomainObjEndAPI(&vm);
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user