提交 b922c3d5 编写于 作者: P Peter Krempa

storagevolxml2argvtest: Report better error messages on test failure

If the creation of the commandline failed, libvirt always reported "out
of memory" from the virCommandToString function rather than the proper
error that happened in virStorageBackendCreateQemuImgCmd. Error out
earlier.
上级 1add9c78
......@@ -60,9 +60,7 @@ testCompareXMLToArgvFiles(bool shouldFail,
cmd = virStorageBackendCreateQemuImgCmd(conn, &poolobj, vol, inputvol,
flags, create_tool, imgformat);
actualCmdline = virCommandToString(cmd);
if (!actualCmdline) {
if (!cmd) {
if (shouldFail) {
virResetLastError();
ret = 0;
......@@ -70,6 +68,9 @@ testCompareXMLToArgvFiles(bool shouldFail,
goto cleanup;
}
if (!(actualCmdline = virCommandToString(cmd)))
goto cleanup;
len = virtTestLoadFile(cmdline, &expectedCmdline);
if (len < 0)
goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册