提交 0eb009d2 编写于 作者: J Jiri Denemark

nodeinfotest: Print libvirt error on failure

If linuxNodeInfoCPUPopulate() fails, the test would just print "FAILED"
which is not very informative. It's better to print the real error.
上级 5bf86904
......@@ -43,6 +43,12 @@ static int linuxTestCompareFiles(const char *cpuinfofile, const char *outputfile
memset(&nodeinfo, 0, sizeof(nodeinfo));
if (linuxNodeInfoCPUPopulate(cpuinfo, &nodeinfo) < 0) {
if (virTestGetDebug()) {
virErrorPtr error = virSaveLastError();
if (error && error->code != VIR_ERR_OK)
fprintf(stderr, "\n%s\n", error->message);
virFreeError(error);
}
fclose(cpuinfo);
return -1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册