Return a list of virResctrlMonitorStatsPtr instead of a virResctrlMonitorStats array in virResctrlMonitorGetStats. Signed-off-by: Wang Huaqiang <huaqiang.wang@xxxxxxxxx> --- src/util/virresctrl.c | 10 +++++----- src/util/virresctrl.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index b32eedc..3268310 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -2647,8 +2647,8 @@ virResctrlMonitorStatsSorter(const void *a, * @monitor: The monitor that the statistic data will be retrieved from. * @resource: The name for resource name. 'llc_occupancy' for cache resource. * "mbm_total_bytes" and "mbm_local_bytes" for memory bandwidth resource. - * @stats: Array of virResctrlMonitorStatsPtr for holding cache or memory - * bandwidth usage data. + * @stats: Pointer of of virResctrlMonitorStatsPtr array for holding cache or + * memory bandwidth usage data. * @nstats: A size_t pointer to hold the returned array length of @stats * * Get cache or memory bandwidth utilization information. @@ -2658,7 +2658,7 @@ virResctrlMonitorStatsSorter(const void *a, static int virResctrlMonitorGetStats(virResctrlMonitorPtr monitor, const char *resource, - virResctrlMonitorStatsPtr *stats, + virResctrlMonitorStatsPtr **stats, size_t *nstats) { int rv = -1; @@ -2729,7 +2729,7 @@ virResctrlMonitorGetStats(virResctrlMonitorPtr monitor, if (rv < 0) goto cleanup; - if (VIR_APPEND_ELEMENT(*stats, *nstats, *stat) < 0) + if (VIR_APPEND_ELEMENT(*stats, *nstats, stat) < 0) goto cleanup; } @@ -2762,7 +2762,7 @@ virResctrlMonitorGetStats(virResctrlMonitorPtr monitor, int virResctrlMonitorGetCacheOccupancy(virResctrlMonitorPtr monitor, - virResctrlMonitorStatsPtr *stats, + virResctrlMonitorStatsPtr **stats, size_t *nstats) { return virResctrlMonitorGetStats(monitor, "llc_occupancy", diff --git a/src/util/virresctrl.h b/src/util/virresctrl.h index 45ec967..e2ed4ee 100644 --- a/src/util/virresctrl.h +++ b/src/util/virresctrl.h @@ -229,6 +229,6 @@ virResctrlMonitorRemove(virResctrlMonitorPtr monitor); int virResctrlMonitorGetCacheOccupancy(virResctrlMonitorPtr monitor, - virResctrlMonitorStatsPtr *caches, - size_t *ncaches); + virResctrlMonitorStatsPtr **stats, + size_t *nstats); #endif /* __VIR_RESCTRL_H__ */ -- 2.7.4 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list