提交 ef0027ce 编写于 作者: W Wang Huaqiang 提交者: John Ferlan

util: Return a list of pointer in virResctrlMonitorGetStats

Return a list of virResctrlMonitorStatsPtr instead of
a virResctrlMonitorStats array in virResctrlMonitorGetStats.
Signed-off-by: NWang Huaqiang <huaqiang.wang@intel.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 70e637c1
...@@ -2647,8 +2647,8 @@ virResctrlMonitorStatsSorter(const void *a, ...@@ -2647,8 +2647,8 @@ virResctrlMonitorStatsSorter(const void *a,
* @monitor: The monitor that the statistic data will be retrieved from. * @monitor: The monitor that the statistic data will be retrieved from.
* @resource: The name for resource name. 'llc_occupancy' for cache resource. * @resource: The name for resource name. 'llc_occupancy' for cache resource.
* "mbm_total_bytes" and "mbm_local_bytes" for memory bandwidth resource. * "mbm_total_bytes" and "mbm_local_bytes" for memory bandwidth resource.
* @stats: Array of virResctrlMonitorStatsPtr for holding cache or memory * @stats: Pointer of of virResctrlMonitorStatsPtr array for holding cache or
* bandwidth usage data. * memory bandwidth usage data.
* @nstats: A size_t pointer to hold the returned array length of @stats * @nstats: A size_t pointer to hold the returned array length of @stats
* *
* Get cache or memory bandwidth utilization information. * Get cache or memory bandwidth utilization information.
...@@ -2658,7 +2658,7 @@ virResctrlMonitorStatsSorter(const void *a, ...@@ -2658,7 +2658,7 @@ virResctrlMonitorStatsSorter(const void *a,
static int static int
virResctrlMonitorGetStats(virResctrlMonitorPtr monitor, virResctrlMonitorGetStats(virResctrlMonitorPtr monitor,
const char *resource, const char *resource,
virResctrlMonitorStatsPtr *stats, virResctrlMonitorStatsPtr **stats,
size_t *nstats) size_t *nstats)
{ {
int rv = -1; int rv = -1;
...@@ -2729,7 +2729,7 @@ virResctrlMonitorGetStats(virResctrlMonitorPtr monitor, ...@@ -2729,7 +2729,7 @@ virResctrlMonitorGetStats(virResctrlMonitorPtr monitor,
if (rv < 0) if (rv < 0)
goto cleanup; goto cleanup;
if (VIR_APPEND_ELEMENT(*stats, *nstats, *stat) < 0) if (VIR_APPEND_ELEMENT(*stats, *nstats, stat) < 0)
goto cleanup; goto cleanup;
} }
...@@ -2762,7 +2762,7 @@ virResctrlMonitorGetStats(virResctrlMonitorPtr monitor, ...@@ -2762,7 +2762,7 @@ virResctrlMonitorGetStats(virResctrlMonitorPtr monitor,
int int
virResctrlMonitorGetCacheOccupancy(virResctrlMonitorPtr monitor, virResctrlMonitorGetCacheOccupancy(virResctrlMonitorPtr monitor,
virResctrlMonitorStatsPtr *stats, virResctrlMonitorStatsPtr **stats,
size_t *nstats) size_t *nstats)
{ {
return virResctrlMonitorGetStats(monitor, "llc_occupancy", return virResctrlMonitorGetStats(monitor, "llc_occupancy",
......
...@@ -229,6 +229,6 @@ virResctrlMonitorRemove(virResctrlMonitorPtr monitor); ...@@ -229,6 +229,6 @@ virResctrlMonitorRemove(virResctrlMonitorPtr monitor);
int int
virResctrlMonitorGetCacheOccupancy(virResctrlMonitorPtr monitor, virResctrlMonitorGetCacheOccupancy(virResctrlMonitorPtr monitor,
virResctrlMonitorStatsPtr *caches, virResctrlMonitorStatsPtr **stats,
size_t *ncaches); size_t *nstats);
#endif /* __VIR_RESCTRL_H__ */ #endif /* __VIR_RESCTRL_H__ */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册