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;
|
||||
virResctrlMonitorCreate;
|
||||
virResctrlMonitorDeterminePath;
|
||||
virResctrlMonitorFreeStats;
|
||||
virResctrlMonitorGetCacheOccupancy;
|
||||
virResctrlMonitorGetID;
|
||||
virResctrlMonitorNew;
|
||||
virResctrlMonitorRemove;
|
||||
virResctrlMonitorSetAlloc;
|
||||
virResctrlMonitorSetID;
|
||||
virResctrlMonitorStatsFree;
|
||||
|
||||
|
||||
# util/virrotatingfile.h
|
||||
|
@ -20696,9 +20696,13 @@ struct _virQEMUResctrlMonData {
|
||||
static void
|
||||
qemuDomainFreeResctrlMonData(virQEMUResctrlMonDataPtr resdata)
|
||||
{
|
||||
size_t i = 0;
|
||||
|
||||
VIR_FREE(resdata->name);
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -2765,25 +2765,19 @@ virResctrlMonitorGetStats(virResctrlMonitorPtr monitor,
|
||||
cleanup:
|
||||
VIR_FREE(datapath);
|
||||
VIR_FREE(filepath);
|
||||
VIR_FREE(stat);
|
||||
virResctrlMonitorStatsFree(stat);
|
||||
VIR_DIR_CLOSE(dirp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
virResctrlMonitorFreeStats(virResctrlMonitorStatsPtr *stats,
|
||||
size_t nstats)
|
||||
virResctrlMonitorStatsFree(virResctrlMonitorStatsPtr stat)
|
||||
{
|
||||
size_t i = 0;
|
||||
|
||||
if (!stats)
|
||||
if (!stat)
|
||||
return;
|
||||
|
||||
for (i = 0; i < nstats; i++)
|
||||
VIR_FREE(stats[i]);
|
||||
|
||||
VIR_FREE(stats);
|
||||
VIR_FREE(stat);
|
||||
}
|
||||
|
||||
|
||||
|
@ -232,5 +232,4 @@ virResctrlMonitorGetCacheOccupancy(virResctrlMonitorPtr monitor,
|
||||
size_t *nstats);
|
||||
|
||||
void
|
||||
virResctrlMonitorFreeStats(virResctrlMonitorStatsPtr *stats,
|
||||
size_t nstats);
|
||||
virResctrlMonitorStatsFree(virResctrlMonitorStatsPtr stats);
|
||||
|
Loading…
Reference in New Issue
Block a user