mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
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.
This commit is contained in:
parent
5bf8690486
commit
0eb009d273
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user