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