mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
util: Check if kernel-provided info is consistent with itself
Just in case someone re-mounted /sys/fs/resctrl with different mount options (cdp), add a check here. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1540780 Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
07dcad41a2
commit
d300b54487
@ -941,6 +941,17 @@ virResctrlAllocParseProcessCache(virResctrlInfoPtr resctrl,
|
||||
if (!mask)
|
||||
return -1;
|
||||
|
||||
if (!resctrl ||
|
||||
level >= resctrl->nlevels ||
|
||||
!resctrl->levels[level] ||
|
||||
!resctrl->levels[level]->types[type]) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Missing or inconsistent resctrl info for "
|
||||
"level '%ud' type '%s'"),
|
||||
level, virCacheTypeToString(type));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (virBitmapShrink(mask, resctrl->levels[level]->types[type]->bits) < 0)
|
||||
goto cleanup;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user