mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
qemuxml2argvtest: Rename "out" labels as "cleanup"
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
98c69644a5
commit
52c087ec52
@ -285,34 +285,34 @@ static int testCompareXMLToArgvFiles(const char *xml,
|
|||||||
memset(&monitor_chr, 0, sizeof(monitor_chr));
|
memset(&monitor_chr, 0, sizeof(monitor_chr));
|
||||||
|
|
||||||
if (!(conn = virGetConnect()))
|
if (!(conn = virGetConnect()))
|
||||||
goto out;
|
goto cleanup;
|
||||||
conn->secretDriver = &fakeSecretDriver;
|
conn->secretDriver = &fakeSecretDriver;
|
||||||
conn->storageDriver = &fakeStorageDriver;
|
conn->storageDriver = &fakeStorageDriver;
|
||||||
|
|
||||||
if (!(vm = virDomainObjNew(driver.xmlopt)))
|
if (!(vm = virDomainObjNew(driver.xmlopt)))
|
||||||
goto out;
|
goto cleanup;
|
||||||
|
|
||||||
if (!(vm->def = virDomainDefParseFile(xml, driver.caps, driver.xmlopt,
|
if (!(vm->def = virDomainDefParseFile(xml, driver.caps, driver.xmlopt,
|
||||||
(VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
(VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||||
parseFlags)))) {
|
parseFlags)))) {
|
||||||
if (flags & FLAG_EXPECT_PARSE_ERROR)
|
if (flags & FLAG_EXPECT_PARSE_ERROR)
|
||||||
goto ok;
|
goto ok;
|
||||||
goto out;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
priv = vm->privateData;
|
priv = vm->privateData;
|
||||||
|
|
||||||
if (virBitmapParse("0-3", &priv->autoNodeset, 4) < 0)
|
if (virBitmapParse("0-3", &priv->autoNodeset, 4) < 0)
|
||||||
goto out;
|
goto cleanup;
|
||||||
|
|
||||||
if (!virDomainDefCheckABIStability(vm->def, vm->def)) {
|
if (!virDomainDefCheckABIStability(vm->def, vm->def)) {
|
||||||
VIR_TEST_DEBUG("ABI stability check failed on %s", xml);
|
VIR_TEST_DEBUG("ABI stability check failed on %s", xml);
|
||||||
goto out;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
vm->def->id = -1;
|
vm->def->id = -1;
|
||||||
|
|
||||||
if (qemuProcessPrepareMonitorChr(&monitor_chr, priv->libDir) < 0)
|
if (qemuProcessPrepareMonitorChr(&monitor_chr, priv->libDir) < 0)
|
||||||
goto out;
|
goto cleanup;
|
||||||
|
|
||||||
virQEMUCapsSetList(qemuCaps,
|
virQEMUCapsSetList(qemuCaps,
|
||||||
QEMU_CAPS_NO_ACPI,
|
QEMU_CAPS_NO_ACPI,
|
||||||
@ -322,7 +322,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
|
|||||||
STREQ(vm->def->emulator, "/usr/bin/qemu-system-x86_64")) {
|
STREQ(vm->def->emulator, "/usr/bin/qemu-system-x86_64")) {
|
||||||
VIR_FREE(vm->def->os.machine);
|
VIR_FREE(vm->def->os.machine);
|
||||||
if (VIR_STRDUP(vm->def->os.machine, "pc-0.11") < 0)
|
if (VIR_STRDUP(vm->def->os.machine, "pc-0.11") < 0)
|
||||||
goto out;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
virQEMUCapsFilterByMachineType(qemuCaps, vm->def->os.machine);
|
virQEMUCapsFilterByMachineType(qemuCaps, vm->def->os.machine);
|
||||||
@ -351,14 +351,14 @@ static int testCompareXMLToArgvFiles(const char *xml,
|
|||||||
VIR_QEMU_PROCESS_START_COLD))) {
|
VIR_QEMU_PROCESS_START_COLD))) {
|
||||||
if (flags & FLAG_EXPECT_FAILURE)
|
if (flags & FLAG_EXPECT_FAILURE)
|
||||||
goto ok;
|
goto ok;
|
||||||
goto out;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(actualargv = virCommandToString(cmd)))
|
if (!(actualargv = virCommandToString(cmd)))
|
||||||
goto out;
|
goto cleanup;
|
||||||
|
|
||||||
if (virTestCompareToFile(actualargv, cmdline) < 0)
|
if (virTestCompareToFile(actualargv, cmdline) < 0)
|
||||||
goto out;
|
goto cleanup;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
@ -366,7 +366,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
|
|||||||
if (ret == 0 && flags & FLAG_EXPECT_FAILURE) {
|
if (ret == 0 && flags & FLAG_EXPECT_FAILURE) {
|
||||||
ret = -1;
|
ret = -1;
|
||||||
VIR_TEST_DEBUG("Error expected but there wasn't any.\n");
|
VIR_TEST_DEBUG("Error expected but there wasn't any.\n");
|
||||||
goto out;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
if (!virTestOOMActive()) {
|
if (!virTestOOMActive()) {
|
||||||
if (flags & FLAG_EXPECT_FAILURE) {
|
if (flags & FLAG_EXPECT_FAILURE) {
|
||||||
@ -377,7 +377,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
cleanup:
|
||||||
VIR_FREE(log);
|
VIR_FREE(log);
|
||||||
VIR_FREE(actualargv);
|
VIR_FREE(actualargv);
|
||||||
virDomainChrSourceDefClear(&monitor_chr);
|
virDomainChrSourceDefClear(&monitor_chr);
|
||||||
@ -476,17 +476,17 @@ testPrepareExtraFlags(struct testInfo *info,
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if (!(info->qemuCaps = virQEMUCapsNew()))
|
if (!(info->qemuCaps = virQEMUCapsNew()))
|
||||||
goto out;
|
goto cleanup;
|
||||||
|
|
||||||
if (testAddCPUModels(info->qemuCaps, skipLegacyCPUs) < 0)
|
if (testAddCPUModels(info->qemuCaps, skipLegacyCPUs) < 0)
|
||||||
goto out;
|
goto cleanup;
|
||||||
|
|
||||||
if (testQemuCapsSetGIC(info->qemuCaps, gic) < 0)
|
if (testQemuCapsSetGIC(info->qemuCaps, gic) < 0)
|
||||||
goto out;
|
goto cleanup;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
out:
|
cleanup:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user