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

util: Check for empty allocation instead of just NULL pointer

When working on the CAT series one of the changes was that the pointer got
allocated in another part of the code, even when resctrl was not available on
the host system.  However this one particular place neglected that so it needs
to be fixed in order to get the proper error message when requesting
<cachetune/> on HW with no support for it.
Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
上级 b7a79124
...@@ -1472,7 +1472,7 @@ virResctrlAllocCreate(virResctrlInfoPtr resctrl, ...@@ -1472,7 +1472,7 @@ virResctrlAllocCreate(virResctrlInfoPtr resctrl,
if (!alloc) if (!alloc)
return 0; return 0;
if (!resctrl) { if (virResctrlInfoIsEmpty(resctrl)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Resource control is not supported on this host")); _("Resource control is not supported on this host"));
return -1; return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册