mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 11:31:16 +00:00
util: Refactor and rename 'virResctrlMonitorFreeStats'
Refactor and rename 'virResctrlMonitorFreeStats' to 'virResctrlMonitorStatsFree' to free one 'virResctrlMonitorStatsPtr' object. Signed-off-by: Wang Huaqiang <huaqiang.wang@intel.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
6d7d79856c
commit
782dd229ac
@ -2833,13 +2833,13 @@ virResctrlInfoNew;
|
|||||||
virResctrlMonitorAddPID;
|
virResctrlMonitorAddPID;
|
||||||
virResctrlMonitorCreate;
|
virResctrlMonitorCreate;
|
||||||
virResctrlMonitorDeterminePath;
|
virResctrlMonitorDeterminePath;
|
||||||
virResctrlMonitorFreeStats;
|
|
||||||
virResctrlMonitorGetCacheOccupancy;
|
virResctrlMonitorGetCacheOccupancy;
|
||||||
virResctrlMonitorGetID;
|
virResctrlMonitorGetID;
|
||||||
virResctrlMonitorNew;
|
virResctrlMonitorNew;
|
||||||
virResctrlMonitorRemove;
|
virResctrlMonitorRemove;
|
||||||
virResctrlMonitorSetAlloc;
|
virResctrlMonitorSetAlloc;
|
||||||
virResctrlMonitorSetID;
|
virResctrlMonitorSetID;
|
||||||
|
virResctrlMonitorStatsFree;
|
||||||
|
|
||||||
|
|
||||||
# util/virrotatingfile.h
|
# util/virrotatingfile.h
|
||||||
|
@ -20696,9 +20696,13 @@ struct _virQEMUResctrlMonData {
|
|||||||
static void
|
static void
|
||||||
qemuDomainFreeResctrlMonData(virQEMUResctrlMonDataPtr resdata)
|
qemuDomainFreeResctrlMonData(virQEMUResctrlMonDataPtr resdata)
|
||||||
{
|
{
|
||||||
|
size_t i = 0;
|
||||||
|
|
||||||
VIR_FREE(resdata->name);
|
VIR_FREE(resdata->name);
|
||||||
VIR_FREE(resdata->vcpus);
|
VIR_FREE(resdata->vcpus);
|
||||||
virResctrlMonitorFreeStats(resdata->stats, resdata->nstats);
|
for (i = 0; i < resdata->nstats; i++)
|
||||||
|
virResctrlMonitorStatsFree(resdata->stats[i]);
|
||||||
|
VIR_FREE(resdata->stats);
|
||||||
VIR_FREE(resdata);
|
VIR_FREE(resdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2765,25 +2765,19 @@ virResctrlMonitorGetStats(virResctrlMonitorPtr monitor,
|
|||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(datapath);
|
VIR_FREE(datapath);
|
||||||
VIR_FREE(filepath);
|
VIR_FREE(filepath);
|
||||||
VIR_FREE(stat);
|
virResctrlMonitorStatsFree(stat);
|
||||||
VIR_DIR_CLOSE(dirp);
|
VIR_DIR_CLOSE(dirp);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
virResctrlMonitorFreeStats(virResctrlMonitorStatsPtr *stats,
|
virResctrlMonitorStatsFree(virResctrlMonitorStatsPtr stat)
|
||||||
size_t nstats)
|
|
||||||
{
|
{
|
||||||
size_t i = 0;
|
if (!stat)
|
||||||
|
|
||||||
if (!stats)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (i = 0; i < nstats; i++)
|
VIR_FREE(stat);
|
||||||
VIR_FREE(stats[i]);
|
|
||||||
|
|
||||||
VIR_FREE(stats);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -232,5 +232,4 @@ virResctrlMonitorGetCacheOccupancy(virResctrlMonitorPtr monitor,
|
|||||||
size_t *nstats);
|
size_t *nstats);
|
||||||
|
|
||||||
void
|
void
|
||||||
virResctrlMonitorFreeStats(virResctrlMonitorStatsPtr *stats,
|
virResctrlMonitorStatsFree(virResctrlMonitorStatsPtr stats);
|
||||||
size_t nstats);
|
|
||||||
|
Loading…
Reference in New Issue
Block a user