提交 e802d7ef 编写于 作者: L Luyao Huang 提交者: John Ferlan

util: Adjust error paths for virNumaSetPagePoolSize

Commit id '1c24cfe9' added new checks and error messaes for failure
scenarios. Let's adjust those error messages to after the call to
virNumaGetHugePageInfoPath in order to provide a more specific error
message depending on node and page_size

After this patch:
 # virsh allocpages --pagesize 2047 --pagecount 1 --cellno 0
 error: operation failed: page size 2047 is not available on node 0

 # virsh allocpages --pagesize 2047 --pagecount 1
 error: operation failed: page size 2047 is not available
Signed-off-by: NLuyao Huang <lhuang@redhat.com>
上级 deb8c66d
......@@ -836,19 +836,25 @@ virNumaSetPagePoolSize(int node,
goto cleanup;
}
if (node != -1 && !virNumaNodeIsAvailable(node)) {
virReportError(VIR_ERR_OPERATION_FAILED,
_("NUMA node %d is not available"),
node);
goto cleanup;
}
if (virNumaGetHugePageInfoPath(&nr_path, node, page_size, "nr_hugepages") < 0)
goto cleanup;
if (!virFileExists(nr_path)) {
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("page size or NUMA node not available"));
if (node != -1) {
if (!virNumaNodeIsAvailable(node)) {
virReportError(VIR_ERR_OPERATION_FAILED,
_("NUMA node %d is not available"),
node);
} else {
virReportError(VIR_ERR_OPERATION_FAILED,
_("page size %u is not available on node %d"),
page_size, node);
}
} else {
virReportError(VIR_ERR_OPERATION_FAILED,
_("page size %u is not available"),
page_size);
}
goto cleanup;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册