提交 d300b544 编写于 作者: M Martin Kletzander

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=1540780Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
上级 07dcad41
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册