On 9/12/24 16:47, Martin Kletzander wrote:
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- src/conf/capabilities.c | 5 ++- src/util/virresctrl.c | 77 ++++++++++++++++++++++++----------------- src/util/virresctrl.h | 3 ++ 3 files changed, 53 insertions(+), 32 deletions(-)
diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 1d3b7050b2e3..3d0602e1b6fe 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -2128,7 +2128,9 @@ virCapabilitiesInitResctrlMemory(virCaps *caps) node = g_new0(virCapsHostMemBWNode, 1);
if (virResctrlInfoGetMemoryBandwidth(caps->host.resctrl, - bank->level, &node->control) > 0) { + bank->level, + bank->id, + &node->control) > 0) { node->id = bank->id; node->cpus = virBitmapNewCopy(bank->cpus);
@@ -2269,6 +2271,7 @@ virCapabilitiesInitCaches(virCaps *caps) if (i == caps->host.cache.nbanks) { /* If it is a new cache, then update its resctrl information. */ if (virResctrlInfoGetCache(caps->host.resctrl, + bank->id, bank->level, bank->size, &bank->ncontrols, diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index f3ec4d67059f..3acc1447ad56 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -121,6 +121,7 @@ struct _virResctrlInfoPerType { unsigned int bits; unsigned int max_cache_id;
+ virBitmap *cache_ids;
I'd put an empty line after this to make it more obvious the comment doesn't belong to @cache_ids.
/* In order to be self-sufficient we need size information per cache. * Funnily enough, one of the outcomes of the resctrl design is that it * does not account for different sizes per cache on the same level. So
Michal