Indent top-level labels by one space in tests/

This commit is contained in:
Ján Tomko 2014-03-25 07:53:44 +01:00
parent 9e7ecabf94
commit 2dcdb7f654
80 changed files with 300 additions and 300 deletions

View File

@ -156,7 +156,7 @@ int main(int argc, char **argv) {
return EXIT_SUCCESS; return EXIT_SUCCESS;
error: error:
return EXIT_FAILURE; return EXIT_FAILURE;
} }

View File

@ -93,7 +93,7 @@ static int checkoutput(const char *testname)
ret = 0; ret = 0;
cleanup: cleanup:
if (actualname) if (actualname)
unlink(actualname); unlink(actualname);
VIR_FREE(actuallog); VIR_FREE(actuallog);
@ -123,7 +123,7 @@ static int test0(const void *unused ATTRIBUTE_UNUSED)
virResetLastError(); virResetLastError();
ret = 0; ret = 0;
cleanup: cleanup:
virCommandFree(cmd); virCommandFree(cmd);
return ret; return ret;
} }
@ -152,7 +152,7 @@ static int test1(const void *unused ATTRIBUTE_UNUSED)
goto cleanup; goto cleanup;
ret = 0; ret = 0;
cleanup: cleanup:
virCommandFree(cmd); virCommandFree(cmd);
return ret; return ret;
} }
@ -221,7 +221,7 @@ static int test3(const void *unused ATTRIBUTE_UNUSED)
ret = checkoutput("test3"); ret = checkoutput("test3");
cleanup: cleanup:
virCommandFree(cmd); virCommandFree(cmd);
/* coverity[double_close] */ /* coverity[double_close] */
VIR_FORCE_CLOSE(newfd1); VIR_FORCE_CLOSE(newfd1);
@ -263,7 +263,7 @@ static int test4(const void *unused ATTRIBUTE_UNUSED)
ret = checkoutput("test4"); ret = checkoutput("test4");
cleanup: cleanup:
virCommandFree(cmd); virCommandFree(cmd);
if (pidfile) if (pidfile)
unlink(pidfile); unlink(pidfile);
@ -512,7 +512,7 @@ static int test13(const void *unused ATTRIBUTE_UNUSED)
ret = checkoutput("test13"); ret = checkoutput("test13");
cleanup: cleanup:
virCommandFree(cmd); virCommandFree(cmd);
VIR_FREE(outactual); VIR_FREE(outactual);
return ret; return ret;
@ -584,7 +584,7 @@ static int test14(const void *unused ATTRIBUTE_UNUSED)
ret = checkoutput("test14"); ret = checkoutput("test14");
cleanup: cleanup:
virCommandFree(cmd); virCommandFree(cmd);
VIR_FREE(outactual); VIR_FREE(outactual);
VIR_FREE(erractual); VIR_FREE(erractual);
@ -615,7 +615,7 @@ static int test15(const void *unused ATTRIBUTE_UNUSED)
ret = checkoutput("test15"); ret = checkoutput("test15");
cleanup: cleanup:
VIR_FREE(cwd); VIR_FREE(cwd);
virCommandFree(cmd); virCommandFree(cmd);
@ -661,7 +661,7 @@ static int test16(const void *unused ATTRIBUTE_UNUSED)
ret = checkoutput("test16"); ret = checkoutput("test16");
cleanup: cleanup:
virCommandFree(cmd); virCommandFree(cmd);
VIR_FORCE_CLOSE(fd); VIR_FORCE_CLOSE(fd);
VIR_FREE(outactual); VIR_FREE(outactual);
@ -718,7 +718,7 @@ static int test17(const void *unused ATTRIBUTE_UNUSED)
} }
ret = 0; ret = 0;
cleanup: cleanup:
virCommandFree(cmd); virCommandFree(cmd);
VIR_FREE(outbuf); VIR_FREE(outbuf);
VIR_FREE(errbuf); VIR_FREE(errbuf);
@ -766,7 +766,7 @@ static int test18(const void *unused ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virCommandFree(cmd); virCommandFree(cmd);
if (pidfile) if (pidfile)
unlink(pidfile); unlink(pidfile);
@ -806,7 +806,7 @@ static int test19(const void *unused ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virCommandFree(cmd); virCommandFree(cmd);
return ret; return ret;
} }
@ -841,7 +841,7 @@ static int test20(const void *unused ATTRIBUTE_UNUSED)
} }
ret = checkoutput("test20"); ret = checkoutput("test20");
cleanup: cleanup:
virCommandFree(cmd); virCommandFree(cmd);
VIR_FREE(buf); VIR_FREE(buf);
return ret; return ret;
@ -900,7 +900,7 @@ static int test21(const void *unused ATTRIBUTE_UNUSED)
} }
ret = checkoutput("test21"); ret = checkoutput("test21");
cleanup: cleanup:
VIR_FREE(outbuf); VIR_FREE(outbuf);
VIR_FREE(errbuf); VIR_FREE(errbuf);
virCommandFree(cmd); virCommandFree(cmd);
@ -957,7 +957,7 @@ test22(const void *unused ATTRIBUTE_UNUSED)
} }
ret = 0; ret = 0;
cleanup: cleanup:
virCommandFree(cmd); virCommandFree(cmd);
return ret; return ret;
} }
@ -1016,7 +1016,7 @@ test23(const void *unused ATTRIBUTE_UNUSED)
} }
ret = 0; ret = 0;
cleanup: cleanup:
return ret; return ret;
} }
@ -1178,7 +1178,7 @@ mymain(void)
} }
virMutexUnlock(&test->lock); virMutexUnlock(&test->lock);
cleanup: cleanup:
if (test->running) if (test->running)
virThreadJoin(&test->thread); virThreadJoin(&test->thread);

View File

@ -96,7 +96,7 @@ cpuTestLoadXML(const char *arch, const char *name)
cpu = virCPUDefParseXML(ctxt->node, ctxt, VIR_CPU_TYPE_AUTO); cpu = virCPUDefParseXML(ctxt->node, ctxt, VIR_CPU_TYPE_AUTO);
cleanup: cleanup:
xmlXPathFreeContext(ctxt); xmlXPathFreeContext(ctxt);
xmlFreeDoc(doc); xmlFreeDoc(doc);
VIR_FREE(xml); VIR_FREE(xml);
@ -136,14 +136,14 @@ cpuTestLoadMultiXML(const char *arch,
*count = n; *count = n;
cleanup: cleanup:
VIR_FREE(xml); VIR_FREE(xml);
VIR_FREE(nodes); VIR_FREE(nodes);
xmlXPathFreeContext(ctxt); xmlXPathFreeContext(ctxt);
xmlFreeDoc(doc); xmlFreeDoc(doc);
return cpus; return cpus;
cleanup_cpus: cleanup_cpus:
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
virCPUDefFree(cpus[i]); virCPUDefFree(cpus[i]);
VIR_FREE(cpus); VIR_FREE(cpus);
@ -181,7 +181,7 @@ cpuTestCompareXML(const char *arch,
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(xml); VIR_FREE(xml);
VIR_FREE(expected); VIR_FREE(expected);
VIR_FREE(actual); VIR_FREE(actual);
@ -247,7 +247,7 @@ cpuTestCompare(const void *arg)
ret = 0; ret = 0;
cleanup: cleanup:
virCPUDefFree(host); virCPUDefFree(host);
virCPUDefFree(cpu); virCPUDefFree(cpu);
return ret; return ret;
@ -307,7 +307,7 @@ cpuTestGuestData(const void *arg)
ret = cpuTestCompareXML(data->arch, guest, result, 0); ret = cpuTestCompareXML(data->arch, guest, result, 0);
cleanup: cleanup:
VIR_FREE(result); VIR_FREE(result);
cpuDataFree(guestData); cpuDataFree(guestData);
virCPUDefFree(host); virCPUDefFree(host);
@ -374,7 +374,7 @@ cpuTestBaseline(const void *arg)
ret = 0; ret = 0;
cleanup: cleanup:
if (cpus) { if (cpus) {
for (i = 0; i < ncpus; i++) for (i = 0; i < ncpus; i++)
virCPUDefFree(cpus[i]); virCPUDefFree(cpus[i]);
@ -408,7 +408,7 @@ cpuTestUpdate(const void *arg)
ret = cpuTestCompareXML(data->arch, cpu, result, ret = cpuTestCompareXML(data->arch, cpu, result,
VIR_DOMAIN_XML_UPDATE_CPU); VIR_DOMAIN_XML_UPDATE_CPU);
cleanup: cleanup:
virCPUDefFree(host); virCPUDefFree(host);
virCPUDefFree(cpu); virCPUDefFree(cpu);
VIR_FREE(result); VIR_FREE(result);
@ -449,7 +449,7 @@ cpuTestHasFeature(const void *arg)
ret = 0; ret = 0;
cleanup: cleanup:
cpuDataFree(hostData); cpuDataFree(hostData);
virCPUDefFree(host); virCPUDefFree(host);
return ret; return ret;

View File

@ -78,7 +78,7 @@ static int testGetFilesystem(const void *opaque)
ret = 0; ret = 0;
cleanup: cleanup:
virDomainDefFree(def); virDomainDefFree(def);
VIR_FREE(xmlData); VIR_FREE(xmlData);
VIR_FREE(filename); VIR_FREE(filename);

View File

@ -65,7 +65,7 @@ testFilterXML(char *xml)
ret = virBufferContentAndReset(&buf); ret = virBufferContentAndReset(&buf);
cleanup: cleanup:
virBufferFreeAndReset(&buf); virBufferFreeAndReset(&buf);
virStringFreeList(xmlLines); virStringFreeList(xmlLines);
return ret; return ret;
@ -123,7 +123,7 @@ testCompareXMLToXMLFiles(const char *inxml,
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(inXmlData); VIR_FREE(inXmlData);
VIR_FREE(outXmlData); VIR_FREE(outXmlData);
VIR_FREE(actual); VIR_FREE(actual);
@ -226,7 +226,7 @@ mymain(void)
DO_TEST_IN("description_only", NULL); DO_TEST_IN("description_only", NULL);
DO_TEST_IN("name_only", NULL); DO_TEST_IN("name_only", NULL);
cleanup: cleanup:
if (testSnapshotXMLVariableLineRegex) if (testSnapshotXMLVariableLineRegex)
regfree(testSnapshotXMLVariableLineRegex); regfree(testSnapshotXMLVariableLineRegex);
VIR_FREE(testSnapshotXMLVariableLineRegex); VIR_FREE(testSnapshotXMLVariableLineRegex);

View File

@ -75,14 +75,14 @@ testParseDatastorePath(const void *data ATTRIBUTE_UNUSED)
} }
} }
cleanup: cleanup:
VIR_FREE(datastoreName); VIR_FREE(datastoreName);
VIR_FREE(directoryName); VIR_FREE(directoryName);
VIR_FREE(directoryAndFileName); VIR_FREE(directoryAndFileName);
return result; return result;
failure: failure:
result = -1; result = -1;
goto cleanup; goto cleanup;

View File

@ -107,7 +107,7 @@ test3(const void *data ATTRIBUTE_UNUSED)
goto cleanup; goto cleanup;
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(wwnn); VIR_FREE(wwnn);
VIR_FREE(wwpn); VIR_FREE(wwpn);
VIR_FREE(fabric_wwn); VIR_FREE(fabric_wwn);
@ -133,7 +133,7 @@ test4(const void *data ATTRIBUTE_UNUSED)
goto cleanup; goto cleanup;
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(hostname); VIR_FREE(hostname);
return ret; return ret;
} }
@ -153,7 +153,7 @@ test5(const void *data ATTRIBUTE_UNUSED)
goto cleanup; goto cleanup;
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(hostname); VIR_FREE(hostname);
return ret; return ret;
} }
@ -180,7 +180,7 @@ mymain(void)
if (virtTestRun("test5", test5, NULL) < 0) if (virtTestRun("test5", test5, NULL) < 0)
ret = -1; ret = -1;
cleanup: cleanup:
VIR_FREE(fchost_prefix); VIR_FREE(fchost_prefix);
return ret; return ret;
} }

View File

@ -147,7 +147,7 @@ static int testFDStreamReadCommon(const char *scratchdir, bool blocking)
} }
ret = 0; ret = 0;
cleanup: cleanup:
if (st) if (st)
virStreamFree(st); virStreamFree(st);
VIR_FORCE_CLOSE(fd); VIR_FORCE_CLOSE(fd);
@ -290,7 +290,7 @@ static int testFDStreamWriteCommon(const char *scratchdir, bool blocking)
goto cleanup; goto cleanup;
ret = 0; ret = 0;
cleanup: cleanup:
if (st) if (st)
virStreamFree(st); virStreamFree(st);
VIR_FORCE_CLOSE(fd); VIR_FORCE_CLOSE(fd);

View File

@ -49,7 +49,7 @@ testJSONFromString(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
virJSONValueFree(json); virJSONValueFree(json);
return ret; return ret;
} }
@ -122,7 +122,7 @@ testJSONAddRemove(const void *data)
} }
ret = 0; ret = 0;
cleanup: cleanup:
virJSONValueFree(json); virJSONValueFree(json);
virJSONValueFree(name); virJSONValueFree(name);
VIR_FREE(result); VIR_FREE(result);

View File

@ -153,7 +153,7 @@ testCorrupt(const void *opaque)
break; break;
} }
cleanup: cleanup:
VIR_FREE(newdata); VIR_FREE(newdata);
daemonConfigFree(conf); daemonConfigFree(conf);
return ret; return ret;
@ -232,7 +232,7 @@ mymain(void)
ret = -1; ret = -1;
} }
cleanup: cleanup:
VIR_FREE(filename); VIR_FREE(filename);
VIR_FREE(filedata); VIR_FREE(filedata);
VIR_FREE(params); VIR_FREE(params);

View File

@ -53,7 +53,7 @@ testCompareXMLToConfigFiles(const char *xml,
ret = 0; ret = 0;
fail: fail:
VIR_FREE(expectxml); VIR_FREE(expectxml);
VIR_FREE(actualxml); VIR_FREE(actualxml);
VIR_FREE(config); VIR_FREE(config);
@ -82,7 +82,7 @@ testCompareXMLToConfigHelper(const void *data)
result = testCompareXMLToConfigFiles(xml, config, info->expectError); result = testCompareXMLToConfigFiles(xml, config, info->expectError);
cleanup: cleanup:
VIR_FREE(xml); VIR_FREE(xml);
VIR_FREE(config); VIR_FREE(config);
return result; return result;

View File

@ -101,7 +101,7 @@ testCompareXMLToXMLHelper(const void *data)
} }
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(xml_in); VIR_FREE(xml_in);
VIR_FREE(xml_out); VIR_FREE(xml_out);
return ret; return ret;

View File

@ -76,7 +76,7 @@ getMetadataFromXML(virDomainPtr dom)
ret = virXMLNodeToString(node->doc, node); ret = virXMLNodeToString(node->doc, node);
cleanup: cleanup:
VIR_FREE(xml); VIR_FREE(xml);
xmlFreeDoc(doc); xmlFreeDoc(doc);
xmlXPathFreeContext(ctxt); xmlXPathFreeContext(ctxt);
@ -156,7 +156,7 @@ verifyMetadata(virDomainPtr dom,
ret = true; ret = true;
cleanup: cleanup:
VIR_FREE(metadataXML); VIR_FREE(metadataXML);
VIR_FREE(metadataAPI); VIR_FREE(metadataAPI);

View File

@ -93,7 +93,7 @@ testCompareXMLToConfHelper(const void *data)
result = testCompareXMLToConfFiles(inxml, outxml, info->caps); result = testCompareXMLToConfFiles(inxml, outxml, info->caps);
cleanup: cleanup:
VIR_FREE(inxml); VIR_FREE(inxml);
VIR_FREE(outxml); VIR_FREE(outxml);

View File

@ -74,7 +74,7 @@ testCompareXMLToXMLHelper(const void *data)
result = testCompareXMLToXMLFiles(inxml, outxml, info->flags); result = testCompareXMLToXMLFiles(inxml, outxml, info->flags);
cleanup: cleanup:
VIR_FREE(inxml); VIR_FREE(inxml);
VIR_FREE(outxml); VIR_FREE(outxml);

View File

@ -56,7 +56,7 @@ testCompareXMLToXMLFiles(const char *netxml, const char *updatexml,
ret = 0; ret = 0;
fail: fail:
if (expectFailure) { if (expectFailure) {
if (ret == 0) { if (ret == 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", "Failed to fail."); virReportError(VIR_ERR_INTERNAL_ERROR, "%s", "Failed to fail.");
@ -66,7 +66,7 @@ fail:
ret = 0; ret = 0;
} }
} }
error: error:
VIR_FREE(netXmlData); VIR_FREE(netXmlData);
VIR_FREE(updateXmlData); VIR_FREE(updateXmlData);
VIR_FREE(outXmlData); VIR_FREE(outXmlData);
@ -109,7 +109,7 @@ testCompareXMLToXMLHelper(const void *data)
info->command, info->section, info->command, info->section,
info->parentIndex, info->expectFailure); info->parentIndex, info->expectFailure);
cleanup: cleanup:
VIR_FREE(netxml); VIR_FREE(netxml);
VIR_FREE(updatexml); VIR_FREE(updatexml);
VIR_FREE(outxml); VIR_FREE(outxml);

View File

@ -73,7 +73,7 @@ linuxTestCompareFiles(const char *cpuinfofile,
ret = 0; ret = 0;
fail: fail:
VIR_FREE(expectData); VIR_FREE(expectData);
VIR_FREE(actualData); VIR_FREE(actualData);
return ret; return ret;
@ -157,7 +157,7 @@ linuxCPUStatsCompareFiles(const char *cpustatfile,
ret = 0; ret = 0;
fail: fail:
virBufferFreeAndReset(&buf); virBufferFreeAndReset(&buf);
VIR_FORCE_FCLOSE(cpustat); VIR_FORCE_FCLOSE(cpustat);
VIR_FREE(expectData); VIR_FREE(expectData);
@ -193,7 +193,7 @@ linuxTestNodeInfo(const void *data)
result = linuxTestCompareFiles(cpuinfo, sysfs_dir, output); result = linuxTestCompareFiles(cpuinfo, sysfs_dir, output);
cleanup: cleanup:
VIR_FREE(cpuinfo); VIR_FREE(cpuinfo);
VIR_FREE(output); VIR_FREE(output);
VIR_FREE(sysfs_dir); VIR_FREE(sysfs_dir);
@ -223,7 +223,7 @@ linuxTestNodeCPUStats(const void *data)
result = linuxCPUStatsCompareFiles(cpustatfile, result = linuxCPUStatsCompareFiles(cpustatfile,
testData->ncpus, testData->ncpus,
outfile); outfile);
fail: fail:
VIR_FREE(cpustatfile); VIR_FREE(cpustatfile);
VIR_FREE(outfile); VIR_FREE(outfile);
return result; return result;

View File

@ -85,7 +85,7 @@ testCompareXMLToXMLHelper(const void *data)
result = testCompareXMLToXMLFiles(inxml, outxml, tp->expect_warning); result = testCompareXMLToXMLFiles(inxml, outxml, tp->expect_warning);
cleanup: cleanup:
VIR_FREE(inxml); VIR_FREE(inxml);
VIR_FREE(outxml); VIR_FREE(outxml);

View File

@ -155,7 +155,7 @@ testDomainCreateXMLOld(const void *data)
registered = false; registered = false;
ret = 0; ret = 0;
cleanup: cleanup:
if (registered) if (registered)
virConnectDomainEventDeregister(test->conn, domainLifecycleCb); virConnectDomainEventDeregister(test->conn, domainLifecycleCb);
if (dom) { if (dom) {
@ -196,7 +196,7 @@ testDomainCreateXMLNew(const void *data)
id = -1; id = -1;
ret = 0; ret = 0;
cleanup: cleanup:
if (id >= 0) if (id >= 0)
virConnectDomainEventDeregisterAny(test->conn, id); virConnectDomainEventDeregisterAny(test->conn, id);
if (dom) { if (dom) {
@ -267,7 +267,7 @@ testDomainCreateXMLMixed(const void *data)
id2 = -1; id2 = -1;
ret = 0; ret = 0;
cleanup: cleanup:
if (id1 >= 0) if (id1 >= 0)
virConnectDomainEventDeregisterAny(test->conn, id1); virConnectDomainEventDeregisterAny(test->conn, id1);
if (id2 >= 0) if (id2 >= 0)
@ -327,7 +327,7 @@ testDomainDefine(const void *data)
} }
cleanup: cleanup:
virConnectDomainEventDeregisterAny(test->conn, id); virConnectDomainEventDeregisterAny(test->conn, id);
if (dom != NULL) if (dom != NULL)
virDomainFree(dom); virDomainFree(dom);
@ -388,7 +388,7 @@ testDomainStartStopEvent(const void *data)
goto cleanup; goto cleanup;
ret = 0; ret = 0;
cleanup: cleanup:
virConnectDomainEventDeregisterAny(test->conn, id); virConnectDomainEventDeregisterAny(test->conn, id);
virDomainFree(dom); virDomainFree(dom);
if (dom2) if (dom2)
@ -426,7 +426,7 @@ testNetworkCreateXML(const void *data)
goto cleanup; goto cleanup;
} }
cleanup: cleanup:
virConnectNetworkEventDeregisterAny(test->conn, id); virConnectNetworkEventDeregisterAny(test->conn, id);
virNetworkDestroy(net); virNetworkDestroy(net);
@ -478,7 +478,7 @@ testNetworkDefine(const void *data)
} }
cleanup: cleanup:
virConnectNetworkEventDeregisterAny(test->conn, id); virConnectNetworkEventDeregisterAny(test->conn, id);
virNetworkFree(net); virNetworkFree(net);
@ -512,7 +512,7 @@ testNetworkStartStopEvent(const void *data)
ret = -1; ret = -1;
goto cleanup; goto cleanup;
} }
cleanup: cleanup:
virConnectNetworkEventDeregisterAny(test->conn, id); virConnectNetworkEventDeregisterAny(test->conn, id);
return ret; return ret;

View File

@ -64,7 +64,7 @@ testReadConfigParam(const void *data ATTRIBUTE_UNUSED)
result = 0; result = 0;
cleanup: cleanup:
VIR_FREE(conf); VIR_FREE(conf);
VIR_FREE(value); VIR_FREE(value);
@ -132,7 +132,7 @@ testReadNetworkConf(const void *data ATTRIBUTE_UNUSED)
result = 0; result = 0;
cleanup: cleanup:
VIR_FREE(actual); VIR_FREE(actual);
virDomainDefFree(def); virDomainDefFree(def);

View File

@ -75,7 +75,7 @@ testQemuAgentFSFreeze(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
} }
@ -125,7 +125,7 @@ testQemuAgentFSThaw(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
} }
@ -155,7 +155,7 @@ testQemuAgentFSTrim(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
} }
@ -201,7 +201,7 @@ testQemuAgentSuspend(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
} }
@ -264,7 +264,7 @@ qemuAgentShutdownTestMonitorHandler(qemuMonitorTestPtr test,
ret = 0; ret = 0;
cleanup: cleanup:
virJSONValueFree(val); virJSONValueFree(val);
return ret; return ret;
@ -349,7 +349,7 @@ testQemuAgentShutdown(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
} }
@ -467,7 +467,7 @@ testQemuAgentCPU(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(cpuinfo); VIR_FREE(cpuinfo);
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
@ -511,7 +511,7 @@ testQemuAgentArbitraryCommand(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(reply); VIR_FREE(reply);
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
@ -572,7 +572,7 @@ testQemuAgentTimeout(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(reply); VIR_FREE(reply);
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;

View File

@ -114,7 +114,7 @@ testCompareXMLToArgvHelper(const void *data)
result = testCompareXMLToArgvFiles(xml, args, !!info->extraFlags); result = testCompareXMLToArgvFiles(xml, args, !!info->extraFlags);
cleanup: cleanup:
VIR_FREE(xml); VIR_FREE(xml);
VIR_FREE(args); VIR_FREE(args);
return result; return result;

View File

@ -80,7 +80,7 @@ testQemuFeedMonitor(char *replies,
return test; return test;
error: error:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return NULL; return NULL;
} }
@ -126,7 +126,7 @@ testQemuGetCaps(char *caps)
xmlXPathFreeContext(ctxt); xmlXPathFreeContext(ctxt);
return qemuCaps; return qemuCaps;
error: error:
VIR_FREE(nodes); VIR_FREE(nodes);
virObjectUnref(qemuCaps); virObjectUnref(qemuCaps);
xmlFreeDoc(xml); xmlFreeDoc(xml);
@ -203,7 +203,7 @@ testQemuCaps(const void *opaque)
goto cleanup; goto cleanup;
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(repliesFile); VIR_FREE(repliesFile);
VIR_FREE(capsFile); VIR_FREE(capsFile);
VIR_FREE(replies); VIR_FREE(replies);

View File

@ -118,7 +118,7 @@ static int testHelpStrParsing(const void *data)
} }
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(path); VIR_FREE(path);
VIR_FREE(help); VIR_FREE(help);
virObjectUnref(flags); virObjectUnref(flags);

View File

@ -91,7 +91,7 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt,
goto cleanup; goto cleanup;
ret = 0; ret = 0;
cleanup: cleanup:
return ret; return ret;
} }
@ -296,7 +296,7 @@ testQemuHotplug(const void *data)
ret = testQemuHotplugUpdate(vm, dev); ret = testQemuHotplugUpdate(vm, dev);
} }
cleanup: cleanup:
VIR_FREE(domain_filename); VIR_FREE(domain_filename);
VIR_FREE(device_filename); VIR_FREE(device_filename);
VIR_FREE(result_filename); VIR_FREE(result_filename);

View File

@ -201,7 +201,7 @@ testQemuMonitorJSONGetStatus(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
} }
@ -303,7 +303,7 @@ testQemuMonitorJSONGetVersion(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
VIR_FREE(package); VIR_FREE(package);
return ret; return ret;
@ -381,7 +381,7 @@ testQemuMonitorJSONGetMachines(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
for (i = 0; i < ninfo; i++) for (i = 0; i < ninfo; i++)
qemuMonitorMachineInfoFree(info[i]); qemuMonitorMachineInfoFree(info[i]);
@ -448,7 +448,7 @@ testQemuMonitorJSONGetCPUDefinitions(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
for (i = 0; i < ncpus; i++) for (i = 0; i < ncpus; i++)
VIR_FREE(cpus[i]); VIR_FREE(cpus[i]);
@ -513,7 +513,7 @@ testQemuMonitorJSONGetCommands(const void *data)
#undef CHECK #undef CHECK
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
for (i = 0; i < ncommands; i++) for (i = 0; i < ncommands; i++)
VIR_FREE(commands[i]); VIR_FREE(commands[i]);
@ -568,7 +568,7 @@ testQemuMonitorJSONGetTPMModels(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
virStringFreeList(tpmmodels); virStringFreeList(tpmmodels);
return ret; return ret;
@ -670,7 +670,7 @@ testQemuMonitorJSONGetCommandLineOptionParameters(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
virStringFreeList(params); virStringFreeList(params);
return ret; return ret;
@ -752,7 +752,7 @@ testQemuMonitorJSONAttachChardev(const void *data)
#undef CHECK_FAIL #undef CHECK_FAIL
#undef DO_CHECK #undef DO_CHECK
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
} }
@ -776,7 +776,7 @@ testQemuMonitorJSONDetachChardev(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
} }
@ -849,7 +849,7 @@ testQemuMonitorJSONGetListPaths(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
for (i = 0; i < npaths; i++) for (i = 0; i < npaths; i++)
qemuMonitorJSONListPathFree(paths[i]); qemuMonitorJSONListPathFree(paths[i]);
@ -899,7 +899,7 @@ testQemuMonitorJSONGetObjectProperty(const void *data)
} }
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
} }
@ -957,7 +957,7 @@ testQemuMonitorJSONSetObjectProperty(const void *data)
} }
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
} }
@ -1017,7 +1017,7 @@ testQemuMonitorJSONGetDeviceAliases(const void *data)
} }
} }
cleanup: cleanup:
virStringFreeList(aliases); virStringFreeList(aliases);
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
@ -1077,7 +1077,7 @@ testQemuMonitorJSONCPU(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
} }
@ -1105,7 +1105,7 @@ testQemuMonitorJSONSimpleFunc(const void *opaque)
goto cleanup; goto cleanup;
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
} }
@ -1242,7 +1242,7 @@ testQemuMonitorJSONqemuMonitorJSONGetCPUInfo(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(cpupids); VIR_FREE(cpupids);
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
@ -1279,7 +1279,7 @@ testQemuMonitorJSONqemuMonitorJSONGetBalloonInfo(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
} }
@ -1331,7 +1331,7 @@ testQemuMonitorJSONqemuMonitorJSONGetVirtType(const void *data)
} }
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
} }
@ -1402,7 +1402,7 @@ testQemuMonitorJSONqemuMonitorJSONGetBlockInfo(const void *data)
} }
ret = 0; ret = 0;
cleanup: cleanup:
virHashFree(blockDevices); virHashFree(blockDevices);
virHashFree(expectedBlockDevices); virHashFree(expectedBlockDevices);
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
@ -1615,7 +1615,7 @@ testQemuMonitorJSONqemuMonitorJSONGetBlockStatsInfo(const void *data)
#undef CHECK #undef CHECK
#undef CHECK0 #undef CHECK0
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
} }
@ -1651,7 +1651,7 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationCacheSize(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
} }
@ -1700,7 +1700,7 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationStatus(const void *data)
} }
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
} }
@ -1739,7 +1739,7 @@ testQemuMonitorJSONqemuMonitorJSONGetSpiceMigrationStatus(const void *data)
} }
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
} }
@ -1803,7 +1803,7 @@ testQemuMonitorJSONqemuMonitorJSONGetPtyPaths(const void *data)
} }
ret = 0; ret = 0;
cleanup: cleanup:
virHashFree(paths); virHashFree(paths);
virHashFree(expectedPaths); virHashFree(expectedPaths);
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
@ -1847,7 +1847,7 @@ testQemuMonitorJSONqemuMonitorJSONSetBlockIoThrottle(const void *data)
goto cleanup; goto cleanup;
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
} }
@ -1883,7 +1883,7 @@ testQemuMonitorJSONqemuMonitorJSONGetTargetArch(const void *data)
} }
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(arch); VIR_FREE(arch);
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
@ -1929,7 +1929,7 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationCapability(const void *data)
goto cleanup; goto cleanup;
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
} }
@ -1954,7 +1954,7 @@ testQemuMonitorJSONqemuMonitorJSONSendKey(const void *data)
goto cleanup; goto cleanup;
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
} }
@ -1997,7 +1997,7 @@ testQemuMonitorJSONqemuMonitorJSONGetDumpGuestMemoryCapability(const void *data)
} }
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
} }
@ -2069,7 +2069,7 @@ testQemuMonitorJSONGetCPUData(const void *opaque)
} }
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(jsonFile); VIR_FREE(jsonFile);
VIR_FREE(dataFile); VIR_FREE(dataFile);
VIR_FREE(jsonStr); VIR_FREE(jsonStr);
@ -2118,7 +2118,7 @@ testQemuMonitorJSONGetNonExistingCPUData(const void *opaque)
} }
ret = 0; ret = 0;
cleanup: cleanup:
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
cpuDataFree(cpuData); cpuDataFree(cpuData);
return ret; return ret;

View File

@ -157,7 +157,7 @@ qemuMonitorReportError(qemuMonitorTestPtr test, const char *errmsg, ...)
ret = qemuMonitorTestAddReponse(test, jsonmsg); ret = qemuMonitorTestAddReponse(test, jsonmsg);
cleanup: cleanup:
va_end(msgargs); va_end(msgargs);
VIR_FREE(msg); VIR_FREE(msg);
VIR_FREE(jsonmsg); VIR_FREE(jsonmsg);
@ -269,7 +269,7 @@ qemuMonitorTestIO(virNetSocketPtr sock,
VIR_EVENT_HANDLE_ERROR)) VIR_EVENT_HANDLE_ERROR))
err = true; err = true;
cleanup: cleanup:
if (err) { if (err) {
virNetSocketRemoveIOCallback(sock); virNetSocketRemoveIOCallback(sock);
virNetSocketClose(sock); virNetSocketClose(sock);
@ -404,7 +404,7 @@ qemuMonitorTestAddHandler(qemuMonitorTestPtr test,
return 0; return 0;
error: error:
if (freecb) if (freecb)
(freecb)(opaque); (freecb)(opaque);
VIR_FREE(item); VIR_FREE(item);
@ -493,7 +493,7 @@ qemuMonitorTestProcessCommandDefault(qemuMonitorTestPtr test,
else else
ret = qemuMonitorTestAddReponse(test, data->response); ret = qemuMonitorTestAddReponse(test, data->response);
cleanup: cleanup:
VIR_FREE(cmdcopy); VIR_FREE(cmdcopy);
virJSONValueFree(val); virJSONValueFree(val);
return ret; return ret;
@ -563,7 +563,7 @@ qemuMonitorTestProcessGuestAgentSync(qemuMonitorTestPtr test,
ret = qemuMonitorTestAddReponse(test, retmsg); ret = qemuMonitorTestAddReponse(test, retmsg);
cleanup: cleanup:
virJSONValueFree(val); virJSONValueFree(val);
VIR_FREE(retmsg); VIR_FREE(retmsg);
return ret; return ret;
@ -653,7 +653,7 @@ qemuMonitorTestProcessCommandWithArgs(qemuMonitorTestPtr test,
/* arguments checked out, return the response */ /* arguments checked out, return the response */
ret = qemuMonitorTestAddReponse(test, data->response); ret = qemuMonitorTestAddReponse(test, data->response);
cleanup: cleanup:
VIR_FREE(argstr); VIR_FREE(argstr);
virJSONValueFree(val); virJSONValueFree(val);
return ret; return ret;
@ -706,7 +706,7 @@ qemuMonitorTestAddItemParams(qemuMonitorTestPtr test,
qemuMonitorTestProcessCommandWithArgs, qemuMonitorTestProcessCommandWithArgs,
data, qemuMonitorTestHandlerDataFree); data, qemuMonitorTestHandlerDataFree);
error: error:
va_end(args); va_end(args);
qemuMonitorTestHandlerDataFree(data); qemuMonitorTestHandlerDataFree(data);
return -1; return -1;
@ -804,10 +804,10 @@ qemuMonitorCommonTestNew(virDomainXMLOptionPtr xmlopt,
if (virNetSocketListen(test->server, 1) < 0) if (virNetSocketListen(test->server, 1) < 0)
goto error; goto error;
cleanup: cleanup:
return test; return test;
error: error:
VIR_FREE(path); VIR_FREE(path);
VIR_FREE(tmpdir_template); VIR_FREE(tmpdir_template);
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
@ -854,7 +854,7 @@ qemuMonitorCommonTestInit(qemuMonitorTestPtr test)
return 0; return 0;
error: error:
return -1; return -1;
} }
@ -913,7 +913,7 @@ qemuMonitorTestNew(bool json,
return test; return test;
error: error:
virDomainChrSourceDefClear(&src); virDomainChrSourceDefClear(&src);
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return NULL; return NULL;
@ -944,7 +944,7 @@ qemuMonitorTestNewAgent(virDomainXMLOptionPtr xmlopt)
return test; return test;
error: error:
virDomainChrSourceDefClear(&src); virDomainChrSourceDefClear(&src);
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return NULL; return NULL;

View File

@ -103,7 +103,7 @@ fakeStoragePoolLookupByName(virConnectPtr conn,
ret = virGetStoragePool(conn, name, fakeUUID, NULL, NULL); ret = virGetStoragePool(conn, name, fakeUUID, NULL, NULL);
cleanup: cleanup:
VIR_FREE(xmlpath); VIR_FREE(xmlpath);
return ret; return ret;
} }
@ -140,11 +140,11 @@ fakeStorageVolLookupByName(virStoragePoolPtr pool,
ret = virGetStorageVol(pool->conn, pool->name, volinfo[1], volinfo[0], ret = virGetStorageVol(pool->conn, pool->name, volinfo[1], volinfo[0],
NULL, NULL); NULL, NULL);
cleanup: cleanup:
virStringFreeList(volinfo); virStringFreeList(volinfo);
return ret; return ret;
fallback: fallback:
ret = virGetStorageVol(pool->conn, pool->name, name, "block", NULL, NULL); ret = virGetStorageVol(pool->conn, pool->name, name, "block", NULL, NULL);
goto cleanup; goto cleanup;
} }
@ -203,7 +203,7 @@ fakeStoragePoolGetXMLDesc(virStoragePoolPtr pool,
goto cleanup; goto cleanup;
} }
cleanup: cleanup:
VIR_FREE(xmlpath); VIR_FREE(xmlpath);
return xmlbuf; return xmlbuf;
@ -403,7 +403,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
ret = 0; ret = 0;
out: out:
VIR_FREE(log); VIR_FREE(log);
VIR_FREE(expectargv); VIR_FREE(expectargv);
VIR_FREE(actualargv); VIR_FREE(actualargv);
@ -444,7 +444,7 @@ testCompareXMLToArgvHelper(const void *data)
info->migrateFrom, info->migrateFd, info->migrateFrom, info->migrateFd,
flags); flags);
cleanup: cleanup:
VIR_FREE(xml); VIR_FREE(xml);
VIR_FREE(args); VIR_FREE(args);
return result; return result;

View File

@ -103,7 +103,7 @@ testCompareXMLToXMLHelper(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(xml_in); VIR_FREE(xml_in);
VIR_FREE(xml_out); VIR_FREE(xml_out);
return ret; return ret;

View File

@ -193,7 +193,7 @@ testCompareXMLToArgvHelper(const void *data)
info->migrateFrom, info->migrateFd, info->migrateFrom, info->migrateFd,
info->json, info->expectError); info->json, info->expectError);
cleanup: cleanup:
VIR_FREE(xml); VIR_FREE(xml);
VIR_FREE(args); VIR_FREE(args);
return result; return result;

View File

@ -35,7 +35,7 @@ testCompareXMLToXMLFiles(const char *inxml, const char *outxml)
ret = 0; ret = 0;
fail: fail:
VIR_FREE(inXmlData); VIR_FREE(inXmlData);
VIR_FREE(outXmlData); VIR_FREE(outXmlData);
VIR_FREE(actual); VIR_FREE(actual);
@ -67,7 +67,7 @@ testCompareXMLToXMLHelper(const void *data)
result = testCompareXMLToXMLFiles(inxml, outxml); result = testCompareXMLToXMLFiles(inxml, outxml);
cleanup: cleanup:
VIR_FREE(inxml); VIR_FREE(inxml);
VIR_FREE(outxml); VIR_FREE(outxml);

View File

@ -139,7 +139,7 @@ testSELinuxLoadFileList(const char *testname,
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FORCE_FCLOSE(fp); VIR_FORCE_FCLOSE(fp);
VIR_FREE(path); VIR_FREE(path);
VIR_FREE(line); VIR_FREE(line);
@ -200,7 +200,7 @@ testSELinuxLoadDef(const char *testname)
testSELinuxMungePath(&def->os.initrd) < 0) testSELinuxMungePath(&def->os.initrd) < 0)
goto cleanup; goto cleanup;
cleanup: cleanup:
VIR_FREE(xmlfile); VIR_FREE(xmlfile);
VIR_FREE(xmlstr); VIR_FREE(xmlstr);
return def; return def;
@ -298,7 +298,7 @@ testSELinuxLabeling(const void *opaque)
ret = 0; ret = 0;
cleanup: cleanup:
if (testSELinuxDeleteDisks(files, nfiles) < 0) if (testSELinuxDeleteDisks(files, nfiles) < 0)
VIR_WARN("unable to fully clean up"); VIR_WARN("unable to fully clean up");

View File

@ -93,7 +93,7 @@ testBuildDomainDef(bool dynamic,
return def; return def;
error: error:
virDomainDefFree(def); virDomainDefFree(def);
return NULL; return NULL;
} }
@ -257,7 +257,7 @@ testSELinuxGenLabel(const void *opaque)
ret = 0; ret = 0;
cleanup: cleanup:
context_free(con); context_free(con);
context_free(imgcon); context_free(imgcon);
virDomainDefFree(def); virDomainDefFree(def);

View File

@ -108,7 +108,7 @@ testCompareHelper(const void *data)
result = testCompareFiles(xml, args, info->version); result = testCompareFiles(xml, args, info->version);
cleanup: cleanup:
VIR_FREE(xml); VIR_FREE(xml);
VIR_FREE(args); VIR_FREE(args);

View File

@ -74,7 +74,7 @@ test_node_info_parser(collie_test test, char *poolxml)
pool->allocation == test.expected_allocation) pool->allocation == test.expected_allocation)
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(output); VIR_FREE(output);
VIR_FREE(poolXmlData); VIR_FREE(poolXmlData);
virStoragePoolDefFree(pool); virStoragePoolDefFree(pool);
@ -118,7 +118,7 @@ test_vdi_list_parser(collie_test test, char *poolxml, char *volxml)
vol->allocation == test.expected_allocation) vol->allocation == test.expected_allocation)
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(output); VIR_FREE(output);
VIR_FREE(poolXmlData); VIR_FREE(poolXmlData);
VIR_FREE(volXmlData); VIR_FREE(volXmlData);
@ -203,7 +203,7 @@ mymain(void)
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(poolxml); VIR_FREE(poolxml);
VIR_FREE(volxml); VIR_FREE(volxml);
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;

View File

@ -67,7 +67,7 @@ testCompareXMLToXMLHelper(const void *data)
result = testCompareXMLToXMLFiles(inxml, outxml); result = testCompareXMLToXMLFiles(inxml, outxml);
cleanup: cleanup:
VIR_FREE(inxml); VIR_FREE(inxml);
VIR_FREE(outxml); VIR_FREE(outxml);

View File

@ -120,7 +120,7 @@ testCompareXMLToArgvFiles(bool shouldFail,
ret = 0; ret = 0;
cleanup: cleanup:
virStoragePoolDefFree(pool); virStoragePoolDefFree(pool);
virStoragePoolDefFree(inputpool); virStoragePoolDefFree(inputpool);
virStorageVolDefFree(vol); virStorageVolDefFree(vol);
@ -181,7 +181,7 @@ testCompareXMLToArgvHelper(const void *data)
cmdline, info->flags, cmdline, info->flags,
info->imgformat); info->imgformat);
cleanup: cleanup:
VIR_FREE(poolxml); VIR_FREE(poolxml);
VIR_FREE(volxml); VIR_FREE(volxml);
VIR_FREE(inputvolxml); VIR_FREE(inputvolxml);

View File

@ -86,7 +86,7 @@ testCompareXMLToXMLHelper(const void *data)
result = testCompareXMLToXMLFiles(poolxml, inxml, outxml); result = testCompareXMLToXMLFiles(poolxml, inxml, outxml);
cleanup: cleanup:
VIR_FREE(poolxml); VIR_FREE(poolxml);
VIR_FREE(inxml); VIR_FREE(inxml);
VIR_FREE(outxml); VIR_FREE(outxml);

View File

@ -89,7 +89,7 @@ testSysinfo(const void *data)
result = 0; result = 0;
cleanup: cleanup:
VIR_FREE(sysfsExpectData); VIR_FREE(sysfsExpectData);
virSysinfoDefFree(ret); virSysinfoDefFree(ret);
virBufferFreeAndReset(&buf); virBufferFreeAndReset(&buf);
@ -123,7 +123,7 @@ sysinfotest_run(const char *test,
ret = EXIT_SUCCESS; ret = EXIT_SUCCESS;
error: error:
VIR_FREE(testdata.decoder); VIR_FREE(testdata.decoder);
VIR_FREE(testdata.sysinfo); VIR_FREE(testdata.sysinfo);
VIR_FREE(testdata.cpuinfo); VIR_FREE(testdata.cpuinfo);

View File

@ -42,7 +42,7 @@ int main(int argc, char **argv)
exit_code = EXIT_SUCCESS; exit_code = EXIT_SUCCESS;
cleanup: cleanup:
VIR_FREE(buffer); VIR_FREE(buffer);
return exit_code; return exit_code;
} }

View File

@ -884,7 +884,7 @@ virCapsPtr virTestGenericCapsInit(void)
return caps; return caps;
error: error:
virObjectUnref(caps); virObjectUnref(caps);
return NULL; return NULL;
} }

View File

@ -49,7 +49,7 @@ virCapsPtr testLXCCapsInit(void)
return caps; return caps;
error: error:
virObjectUnref(caps); virObjectUnref(caps);
return NULL; return NULL;
} }

View File

@ -80,7 +80,7 @@ static int testQemuAddPPC64Guest(virCapsPtr caps)
return 0; return 0;
error: error:
/* No way to free a guest? */ /* No way to free a guest? */
virCapabilitiesFreeMachines(machines, 1); virCapabilitiesFreeMachines(machines, 1);
return -1; return -1;
@ -110,7 +110,7 @@ static int testQemuAddPPCGuest(virCapsPtr caps)
return 0; return 0;
error: error:
/* No way to free a guest? */ /* No way to free a guest? */
virCapabilitiesFreeMachines(machines, 1); virCapabilitiesFreeMachines(machines, 1);
return -1; return -1;
@ -140,7 +140,7 @@ static int testQemuAddS390Guest(virCapsPtr caps)
return 0; return 0;
error: error:
virCapabilitiesFreeMachines(machines, ARRAY_CARDINALITY(s390_machines)); virCapabilitiesFreeMachines(machines, ARRAY_CARDINALITY(s390_machines));
return -1; return -1;
} }
@ -170,7 +170,7 @@ static int testQemuAddArmGuest(virCapsPtr caps)
return 0; return 0;
error: error:
virCapabilitiesFreeMachines(capsmachines, ARRAY_CARDINALITY(machines)); virCapabilitiesFreeMachines(capsmachines, ARRAY_CARDINALITY(machines));
return -1; return -1;
} }
@ -198,7 +198,7 @@ static int testQemuAddAARCH64Guest(virCapsPtr caps)
return 0; return 0;
error: error:
virCapabilitiesFreeMachines(capsmachines, ARRAY_CARDINALITY(machines)); virCapabilitiesFreeMachines(capsmachines, ARRAY_CARDINALITY(machines));
return -1; return -1;
} }
@ -348,7 +348,7 @@ virCapsPtr testQemuCapsInit(void)
return caps; return caps;
cleanup: cleanup:
virCapabilitiesFreeMachines(machines, nmachines); virCapabilitiesFreeMachines(machines, nmachines);
virObjectUnref(caps); virObjectUnref(caps);
return NULL; return NULL;

View File

@ -64,7 +64,7 @@ virCapsPtr testXenCapsInit(void)
return caps; return caps;
cleanup: cleanup:
virCapabilitiesFreeMachines(machines, nmachines); virCapabilitiesFreeMachines(machines, nmachines);
virObjectUnref(caps); virObjectUnref(caps);
return NULL; return NULL;

View File

@ -78,7 +78,7 @@ static int testAuthLookup(const void *args)
} }
ret = 0; ret = 0;
cleanup: cleanup:
return ret; return ret;
} }

View File

@ -57,7 +57,7 @@ test1(const void *data ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
error: error:
virBitmapFree(bitmap); virBitmapFree(bitmap);
return ret; return ret;
} }
@ -138,7 +138,7 @@ test2(const void *data ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
error: error:
virBitmapFree(bitmap); virBitmapFree(bitmap);
VIR_FREE(bitsString2); VIR_FREE(bitsString2);
return ret; return ret;
@ -166,7 +166,7 @@ test3(const void *data ATTRIBUTE_UNUSED)
goto error; goto error;
ret = 0; ret = 0;
error: error:
virBitmapFree(bitmap); virBitmapFree(bitmap);
return ret; return ret;
} }
@ -261,7 +261,7 @@ test4(const void *data ATTRIBUTE_UNUSED)
virBitmapFree(bitmap); virBitmapFree(bitmap);
return 0; return 0;
error: error:
virBitmapFree(bitmap); virBitmapFree(bitmap);
return -1; return -1;
} }
@ -308,7 +308,7 @@ test5(const void *v ATTRIBUTE_UNUSED)
goto error; goto error;
ret = 0; ret = 0;
error: error:
virBitmapFree(bitmap); virBitmapFree(bitmap);
VIR_FREE(data2); VIR_FREE(data2);
return ret; return ret;
@ -392,7 +392,7 @@ test6(const void *v ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
error: error:
virBitmapFree(bitmap); virBitmapFree(bitmap);
VIR_FREE(str); VIR_FREE(str);
return ret; return ret;
@ -433,7 +433,7 @@ test7(const void *v ATTRIBUTE_UNUSED)
return 0; return 0;
error: error:
virBitmapFree(bitmap); virBitmapFree(bitmap);
return -1; return -1;
} }
@ -459,7 +459,7 @@ test8(const void *v ATTRIBUTE_UNUSED)
goto cleanup; goto cleanup;
ret = 0; ret = 0;
cleanup: cleanup:
virBitmapFree(bitmap); virBitmapFree(bitmap);
return ret; return ret;
} }
@ -491,7 +491,7 @@ test9(const void *opaque ATTRIBUTE_UNUSED)
goto cleanup; goto cleanup;
ret = 0; ret = 0;
cleanup: cleanup:
virBitmapFree(bitmap); virBitmapFree(bitmap);
return ret; return ret;

View File

@ -48,7 +48,7 @@ static int testBufInfiniteLoop(const void *data)
virBufferAsprintf(buf, "%s", addstr); virBufferAsprintf(buf, "%s", addstr);
ret = 0; ret = 0;
out: out:
bufret = virBufferContentAndReset(buf); bufret = virBufferContentAndReset(buf);
if (!bufret) { if (!bufret) {
TEST_ERROR("Buffer had error set"); TEST_ERROR("Buffer had error set");
@ -194,7 +194,7 @@ static int testBufTrim(const void *data ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virBufferFreeAndReset(buf); virBufferFreeAndReset(buf);
VIR_FREE(result); VIR_FREE(result);
return ret; return ret;

View File

@ -74,7 +74,7 @@ buildNUMATopology(int seq)
return caps; return caps;
error: error:
virCapabilitiesClearHostNUMACellCPUTopology(cell_cpus, MAX_CPUS_IN_CELL); virCapabilitiesClearHostNUMACellCPUTopology(cell_cpus, MAX_CPUS_IN_CELL);
VIR_FREE(cell_cpus); VIR_FREE(cell_cpus);
virObjectUnref(caps); virObjectUnref(caps);
@ -108,7 +108,7 @@ test_virCapabilitiesGetCpusForNodemask(const void *data ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
error: error:
virObjectUnref(caps); virObjectUnref(caps);
virBitmapFree(nodemask); virBitmapFree(nodemask);
virBitmapFree(cpumap); virBitmapFree(cpumap);

View File

@ -168,7 +168,7 @@ static int make_file(const char *path,
goto cleanup; goto cleanup;
ret = 0; ret = 0;
cleanup: cleanup:
if (fd != -1 && close(fd) < 0) if (fd != -1 && close(fd) < 0)
ret = -1; ret = -1;
free(filepath); free(filepath);
@ -368,7 +368,7 @@ static int make_controller(const char *path, mode_t mode)
} }
ret = 0; ret = 0;
cleanup: cleanup:
return ret; return ret;
} }

View File

@ -180,7 +180,7 @@ static int testCgroupNewForSelf(const void *args ATTRIBUTE_UNUSED)
ret = validateCgroup(cgroup, "", mountsFull, links, placement); ret = validateCgroup(cgroup, "", mountsFull, links, placement);
cleanup: cleanup:
virCgroupFree(&cgroup); virCgroupFree(&cgroup);
return ret; return ret;
} }
@ -266,7 +266,7 @@ static int testCgroupNewForPartition(const void *args ATTRIBUTE_UNUSED)
} }
ret = validateCgroup(cgroup, "/virtualmachines.partition", mountsFull, links, placementFull); ret = validateCgroup(cgroup, "/virtualmachines.partition", mountsFull, links, placementFull);
cleanup: cleanup:
virCgroupFree(&cgroup); virCgroupFree(&cgroup);
return ret; return ret;
} }
@ -315,7 +315,7 @@ static int testCgroupNewForPartitionNested(const void *args ATTRIBUTE_UNUSED)
ret = validateCgroup(cgroup, "/deployment.partition/production.partition", ret = validateCgroup(cgroup, "/deployment.partition/production.partition",
mountsFull, links, placementFull); mountsFull, links, placementFull);
cleanup: cleanup:
virCgroupFree(&cgroup); virCgroupFree(&cgroup);
return ret; return ret;
} }
@ -369,7 +369,7 @@ static int testCgroupNewForPartitionNestedDeep(const void *args ATTRIBUTE_UNUSED
ret = validateCgroup(cgroup, "/user/berrange.user/production.partition", ret = validateCgroup(cgroup, "/user/berrange.user/production.partition",
mountsFull, links, placementFull); mountsFull, links, placementFull);
cleanup: cleanup:
virCgroupFree(&cgroup); virCgroupFree(&cgroup);
return ret; return ret;
} }
@ -405,7 +405,7 @@ static int testCgroupNewForPartitionDomain(const void *args ATTRIBUTE_UNUSED)
ret = validateCgroup(domaincgroup, "/production.partition/foo.libvirt-lxc", mountsFull, links, placement); ret = validateCgroup(domaincgroup, "/production.partition/foo.libvirt-lxc", mountsFull, links, placement);
cleanup: cleanup:
virCgroupFree(&partitioncgroup); virCgroupFree(&partitioncgroup);
virCgroupFree(&domaincgroup); virCgroupFree(&domaincgroup);
return ret; return ret;
@ -456,7 +456,7 @@ static int testCgroupNewForPartitionDomainEscaped(const void *args ATTRIBUTE_UNU
*/ */
ret = validateCgroup(domaincgroup, "/_cgroup.evil/net_cls.evil/__evil.evil/_cpu.foo.libvirt-lxc", mountsFull, links, placement); ret = validateCgroup(domaincgroup, "/_cgroup.evil/net_cls.evil/__evil.evil/_cpu.foo.libvirt-lxc", mountsFull, links, placement);
cleanup: cleanup:
virCgroupFree(&partitioncgroup3); virCgroupFree(&partitioncgroup3);
virCgroupFree(&partitioncgroup2); virCgroupFree(&partitioncgroup2);
virCgroupFree(&partitioncgroup1); virCgroupFree(&partitioncgroup1);
@ -485,7 +485,7 @@ static int testCgroupNewForSelfAllInOne(const void *args ATTRIBUTE_UNUSED)
ret = validateCgroup(cgroup, "", mountsAllInOne, linksAllInOne, placement); ret = validateCgroup(cgroup, "", mountsAllInOne, linksAllInOne, placement);
cleanup: cleanup:
virCgroupFree(&cgroup); virCgroupFree(&cgroup);
return ret; return ret;
} }
@ -513,7 +513,7 @@ static int testCgroupNewForSelfLogind(const void *args ATTRIBUTE_UNUSED)
ret = validateCgroup(cgroup, "", mountsLogind, linksLogind, placement); ret = validateCgroup(cgroup, "", mountsLogind, linksLogind, placement);
cleanup: cleanup:
virCgroupFree(&cgroup); virCgroupFree(&cgroup);
return ret; return ret;
} }
@ -590,7 +590,7 @@ static int testCgroupGetPercpuStats(const void *args ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virCgroupFree(&cgroup); virCgroupFree(&cgroup);
return ret; return ret;
} }
@ -622,7 +622,7 @@ static int testCgroupGetMemoryUsage(const void *args ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virCgroupFree(&cgroup); virCgroupFree(&cgroup);
return ret; return ret;
} }
@ -672,7 +672,7 @@ static int testCgroupGetBlkioIoServiced(const void *args ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virCgroupFree(&cgroup); virCgroupFree(&cgroup);
return ret; return ret;
} }
@ -745,7 +745,7 @@ static int testCgroupGetBlkioIoDeviceServiced(const void *args ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virCgroupFree(&cgroup); virCgroupFree(&cgroup);
return ret; return ret;
} }

View File

@ -117,7 +117,7 @@ static int testMessageSimple(const void *args ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(out_string); VIR_FREE(out_string);
VIR_FREE(out_signature); VIR_FREE(out_signature);
VIR_FREE(out_objectpath); VIR_FREE(out_objectpath);
@ -168,7 +168,7 @@ static int testMessageVariant(const void *args ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(out_str1); VIR_FREE(out_str1);
VIR_FREE(out_str2); VIR_FREE(out_str2);
dbus_message_unref(msg); dbus_message_unref(msg);
@ -221,7 +221,7 @@ static int testMessageArray(const void *args ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(out_str1); VIR_FREE(out_str1);
VIR_FREE(out_str2); VIR_FREE(out_str2);
dbus_message_unref(msg); dbus_message_unref(msg);
@ -311,7 +311,7 @@ static int testMessageArrayRef(const void *args ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(out_int32); VIR_FREE(out_int32);
VIR_FREE(out_str1); VIR_FREE(out_str1);
VIR_FREE(out_str2); VIR_FREE(out_str2);
@ -386,7 +386,7 @@ static int testMessageStruct(const void *args ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(out_string); VIR_FREE(out_string);
VIR_FREE(out_signature); VIR_FREE(out_signature);
VIR_FREE(out_objectpath); VIR_FREE(out_objectpath);
@ -454,7 +454,7 @@ static int testMessageDict(const void *args ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(out_str1); VIR_FREE(out_str1);
VIR_FREE(out_str2); VIR_FREE(out_str2);
VIR_FREE(out_key1); VIR_FREE(out_key1);

View File

@ -51,7 +51,7 @@ test1(const void *data ATTRIBUTE_UNUSED)
goto cleanup; goto cleanup;
ret = 0; ret = 0;
cleanup: cleanup:
return ret; return ret;
} }
@ -82,7 +82,7 @@ test2(const void *data ATTRIBUTE_UNUSED)
goto cleanup; goto cleanup;
ret = 0; ret = 0;
cleanup: cleanup:
return ret; return ret;
} }

View File

@ -121,7 +121,7 @@ testHashGrow(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
virHashFree(hash); virHashFree(hash);
return ret; return ret;
} }
@ -163,7 +163,7 @@ testHashUpdate(const void *data ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virHashFree(hash); virHashFree(hash);
return ret; return ret;
} }
@ -195,7 +195,7 @@ testHashRemove(const void *data ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virHashFree(hash); virHashFree(hash);
return ret; return ret;
} }
@ -290,7 +290,7 @@ testHashRemoveForEach(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
virHashFree(hash); virHashFree(hash);
return ret; return ret;
} }
@ -322,7 +322,7 @@ testHashSteal(const void *data ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virHashFree(hash); virHashFree(hash);
return ret; return ret;
} }
@ -393,7 +393,7 @@ testHashForEach(const void *data ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virHashFree(hash); virHashFree(hash);
return ret; return ret;
} }
@ -453,7 +453,7 @@ testHashRemoveSet(const void *data ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virHashFree(hash); virHashFree(hash);
return ret; return ret;
} }
@ -494,7 +494,7 @@ testHashSearch(const void *data ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virHashFree(hash); virHashFree(hash);
return ret; return ret;
} }
@ -577,7 +577,7 @@ testHashGetItems(const void *data ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(array); VIR_FREE(array);
virHashFree(hash); virHashFree(hash);
return ret; return ret;
@ -655,7 +655,7 @@ testHashEqual(const void *data ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virHashFree(hash1); virHashFree(hash1);
virHashFree(hash2); virHashFree(hash2);
return ret; return ret;

View File

@ -116,7 +116,7 @@ myInit(void)
return 0; return 0;
cleanup: cleanup:
myCleanup(); myCleanup();
return -1; return -1;
} }
@ -139,7 +139,7 @@ virHostdevHostSupportsPassthroughKVM(void)
ret = true; ret = true;
# endif # endif
cleanup: cleanup:
VIR_FORCE_CLOSE(kvmfd); VIR_FORCE_CLOSE(kvmfd);
return ret; return ret;
@ -206,7 +206,7 @@ testVirHostdevPreparePCIHostdevs_unmanaged(const void *oaque ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
return ret; return ret;
} }
@ -240,7 +240,7 @@ testVirHostdevReAttachPCIHostdevs_unmanaged(const void *oaque ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
return ret; return ret;
} }
@ -286,7 +286,7 @@ testVirHostdevPreparePCIHostdevs_managed(const void *oaque ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
return ret; return ret;
} }
@ -318,7 +318,7 @@ testVirHostdevReAttachPCIHostdevs_managed(const void *oaque ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
return ret; return ret;
} }
@ -339,7 +339,7 @@ testVirHostdevDetachPCINodeDevice(const void *oaque ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
return ret; return ret;
} }
static int static int
@ -355,7 +355,7 @@ testVirHostdevResetPCINodeDevice(const void *oaque ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
return ret; return ret;
} }
@ -376,7 +376,7 @@ testVirHostdevReAttachPCINodeDevice(const void *oaque ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
return ret; return ret;
} }
@ -403,7 +403,7 @@ testVirHostdevUpdateActivePCIHostdevs(const void *oaque ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
return ret; return ret;
} }

View File

@ -91,7 +91,7 @@ static int testIdentityAttrs(const void *data ATTRIBUTE_UNUSED)
} }
ret = 0; ret = 0;
cleanup: cleanup:
virObjectUnref(ident); virObjectUnref(ident);
return ret; return ret;
} }
@ -158,7 +158,7 @@ static int testIdentityEqual(const void *data ATTRIBUTE_UNUSED)
} }
ret = 0; ret = 0;
cleanup: cleanup:
virObjectUnref(identa); virObjectUnref(identa);
virObjectUnref(identb); virObjectUnref(identb);
return ret; return ret;
@ -195,7 +195,7 @@ static int testIdentityGetSystem(const void *data)
} }
ret = 0; ret = 0;
cleanup: cleanup:
virObjectUnref(ident); virObjectUnref(ident);
return ret; return ret;
} }

View File

@ -119,7 +119,7 @@ testISCSIGetSession(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
virCommandSetDryRun(NULL, NULL, NULL); virCommandSetDryRun(NULL, NULL, NULL);
VIR_FREE(actual_session); VIR_FREE(actual_session);
return ret; return ret;
@ -165,7 +165,7 @@ testISCSIScanTargets(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
virCommandSetDryRun(NULL, NULL, NULL); virCommandSetDryRun(NULL, NULL, NULL);
for (i = 0; i < ntargets; i++) for (i = 0; i < ntargets; i++)
VIR_FREE(targets[i]); VIR_FREE(targets[i]);

View File

@ -61,7 +61,7 @@ static int testKeycodeMapping(const void *data ATTRIBUTE_UNUSED)
#undef TRANSLATE #undef TRANSLATE
ret = 0; ret = 0;
cleanup: cleanup:
return ret; return ret;
} }
@ -88,7 +88,7 @@ static int testKeycodeStrings(const void *data ATTRIBUTE_UNUSED)
#undef TRANSLATE #undef TRANSLATE
ret = 0; ret = 0;
cleanup: cleanup:
return ret; return ret;
} }

View File

@ -101,7 +101,7 @@ static int testParse(const void *args ATTRIBUTE_UNUSED)
} }
ret = 0; ret = 0;
cleanup: cleanup:
virKeyFileFree(kf); virKeyFileFree(kf);
return ret; return ret;
} }

View File

@ -52,7 +52,7 @@ testKModConfig(const void *args ATTRIBUTE_UNUSED)
} }
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(outbuf); VIR_FREE(outbuf);
return ret; return ret;
} }
@ -80,7 +80,7 @@ checkOutput(virBufferPtr buf, const char *exp_cmd)
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(actual_cmd); VIR_FREE(actual_cmd);
return ret; return ret;
} }
@ -109,7 +109,7 @@ testKModLoad(const void *args)
ret = 0; ret = 0;
cleanup: cleanup:
virCommandSetDryRun(NULL, NULL, NULL); virCommandSetDryRun(NULL, NULL, NULL);
VIR_FREE(errbuf); VIR_FREE(errbuf);
return ret; return ret;
@ -138,7 +138,7 @@ testKModUnload(const void *args)
ret = 0; ret = 0;
cleanup: cleanup:
virCommandSetDryRun(NULL, NULL, NULL); virCommandSetDryRun(NULL, NULL, NULL);
VIR_FREE(errbuf); VIR_FREE(errbuf);
return ret; return ret;

View File

@ -54,7 +54,7 @@ static int testLockSpaceCreate(const void *args ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virLockSpaceFree(lockspace); virLockSpaceFree(lockspace);
rmdir(LOCKSPACE_DIR); rmdir(LOCKSPACE_DIR);
return ret; return ret;
@ -88,7 +88,7 @@ static int testLockSpaceResourceLifecycle(const void *args ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virLockSpaceFree(lockspace); virLockSpaceFree(lockspace);
rmdir(LOCKSPACE_DIR); rmdir(LOCKSPACE_DIR);
return ret; return ret;
@ -134,7 +134,7 @@ static int testLockSpaceResourceLockExcl(const void *args ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virLockSpaceFree(lockspace); virLockSpaceFree(lockspace);
rmdir(LOCKSPACE_DIR); rmdir(LOCKSPACE_DIR);
return ret; return ret;
@ -172,7 +172,7 @@ static int testLockSpaceResourceLockExclAuto(const void *args ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virLockSpaceFree(lockspace); virLockSpaceFree(lockspace);
rmdir(LOCKSPACE_DIR); rmdir(LOCKSPACE_DIR);
return ret; return ret;
@ -226,7 +226,7 @@ static int testLockSpaceResourceLockShr(const void *args ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virLockSpaceFree(lockspace); virLockSpaceFree(lockspace);
rmdir(LOCKSPACE_DIR); rmdir(LOCKSPACE_DIR);
return ret; return ret;
@ -286,7 +286,7 @@ static int testLockSpaceResourceLockShrAuto(const void *args ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virLockSpaceFree(lockspace); virLockSpaceFree(lockspace);
rmdir(LOCKSPACE_DIR); rmdir(LOCKSPACE_DIR);
return ret; return ret;
@ -332,7 +332,7 @@ static int testLockSpaceResourceLockPath(const void *args ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virLockSpaceFree(lockspace); virLockSpaceFree(lockspace);
rmdir(LOCKSPACE_DIR); rmdir(LOCKSPACE_DIR);
return ret; return ret;

View File

@ -100,7 +100,7 @@ testVirNetDevBandwidthSet(const void *data)
} }
ret = 0; ret = 0;
cleanup: cleanup:
virCommandSetDryRun(NULL, NULL, NULL); virCommandSetDryRun(NULL, NULL, NULL);
virNetDevBandwidthFree(band); virNetDevBandwidthFree(band);
virBufferFreeAndReset(&buf); virBufferFreeAndReset(&buf);

View File

@ -82,7 +82,7 @@ static int testMessageHeaderEncode(const void *args ATTRIBUTE_UNUSED)
} }
ret = 0; ret = 0;
cleanup: cleanup:
virNetMessageFree(msg); virNetMessageFree(msg);
return ret; return ret;
} }
@ -178,7 +178,7 @@ static int testMessageHeaderDecode(const void *args ATTRIBUTE_UNUSED)
} }
ret = 0; ret = 0;
cleanup: cleanup:
virNetMessageFree(msg); virNetMessageFree(msg);
return ret; return ret;
} }
@ -274,7 +274,7 @@ static int testMessagePayloadEncode(const void *args ATTRIBUTE_UNUSED)
} }
ret = 0; ret = 0;
cleanup: cleanup:
if (err.message) if (err.message)
VIR_FREE(*err.message); VIR_FREE(*err.message);
if (err.str1) if (err.str1)
@ -449,7 +449,7 @@ static int testMessagePayloadDecode(const void *args ATTRIBUTE_UNUSED)
} }
ret = 0; ret = 0;
cleanup: cleanup:
xdr_free((xdrproc_t)xdr_virNetMessageError, (void*)&err); xdr_free((xdrproc_t)xdr_virNetMessageError, (void*)&err);
virNetMessageFree(msg); virNetMessageFree(msg);
return ret; return ret;
@ -516,7 +516,7 @@ static int testMessagePayloadStreamEncode(const void *args ATTRIBUTE_UNUSED)
} }
ret = 0; ret = 0;
cleanup: cleanup:
virNetMessageFree(msg); virNetMessageFree(msg);
return ret; return ret;
} }

View File

@ -141,7 +141,7 @@ checkProtocols(bool *hasIPv4, bool *hasIPv6,
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FORCE_CLOSE(s4); VIR_FORCE_CLOSE(s4);
VIR_FORCE_CLOSE(s6); VIR_FORCE_CLOSE(s6);
return ret; return ret;
@ -194,7 +194,7 @@ static int testSocketTCPAccept(const void *opaque)
ret = 0; ret = 0;
cleanup: cleanup:
virObjectUnref(ssock); virObjectUnref(ssock);
for (i = 0; i < nlsock; i++) for (i = 0; i < nlsock; i++)
virObjectUnref(lsock[i]); virObjectUnref(lsock[i]);
@ -245,7 +245,7 @@ static int testSocketUNIXAccept(const void *data ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(path); VIR_FREE(path);
virObjectUnref(lsock); virObjectUnref(lsock);
virObjectUnref(ssock); virObjectUnref(ssock);
@ -323,7 +323,7 @@ static int testSocketUNIXAddrs(const void *data ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(path); VIR_FREE(path);
virObjectUnref(lsock); virObjectUnref(lsock);
virObjectUnref(ssock); virObjectUnref(ssock);
@ -356,7 +356,7 @@ static int testSocketCommandNormal(const void *data ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virObjectUnref(csock); virObjectUnref(csock);
return ret; return ret;
} }
@ -379,7 +379,7 @@ static int testSocketCommandFail(const void *data ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virObjectUnref(csock); virObjectUnref(csock);
return ret; return ret;
} }
@ -448,7 +448,7 @@ static int testSocketSSH(const void *opaque)
ret = 0; ret = 0;
cleanup: cleanup:
virObjectUnref(csock); virObjectUnref(csock);
return ret; return ret;
} }

View File

@ -101,7 +101,7 @@ static int testTLSContextInit(const void *opaque)
ret = 0; ret = 0;
cleanup: cleanup:
virObjectUnref(ctxt); virObjectUnref(ctxt);
return ret; return ret;
} }

View File

@ -223,7 +223,7 @@ static int testTLSSessionInit(const void *opaque)
ret = 0; ret = 0;
cleanup: cleanup:
virObjectUnref(serverCtxt); virObjectUnref(serverCtxt);
virObjectUnref(clientCtxt); virObjectUnref(clientCtxt);
virObjectUnref(serverSess); virObjectUnref(serverSess);

View File

@ -219,7 +219,7 @@ pci_read_file(const char *path,
goto cleanup; goto cleanup;
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(newpath); VIR_FREE(newpath);
realclose(fd); realclose(fd);
return ret; return ret;
@ -283,7 +283,7 @@ add_fd(int fd, const char *path)
callbacks[nCallbacks++].fd = fd; callbacks[nCallbacks++].fd = fd;
ret = 0; ret = 0;
cleanup: cleanup:
return ret; return ret;
} }
@ -307,7 +307,7 @@ remove_fd(int fd)
} }
ret = 0; ret = 0;
cleanup: cleanup:
return ret; return ret;
} }
@ -558,7 +558,7 @@ pci_driver_bind(struct pciDriver *driver,
dev->driver = driver; dev->driver = driver;
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(devpath); VIR_FREE(devpath);
VIR_FREE(driverpath); VIR_FREE(driverpath);
return ret; return ret;
@ -592,7 +592,7 @@ pci_driver_unbind(struct pciDriver *driver,
dev->driver = NULL; dev->driver = NULL;
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(devpath); VIR_FREE(devpath);
VIR_FREE(driverpath); VIR_FREE(driverpath);
return ret; return ret;
@ -649,7 +649,7 @@ pci_driver_handle_bind(const char *path)
} }
ret = pci_driver_bind(driver, dev); ret = pci_driver_bind(driver, dev);
cleanup: cleanup:
return ret; return ret;
} }
@ -666,7 +666,7 @@ pci_driver_handle_unbind(const char *path)
} }
ret = pci_driver_unbind(dev->driver, dev); ret = pci_driver_unbind(dev->driver, dev);
cleanup: cleanup:
return ret; return ret;
} }
static int static int
@ -720,7 +720,7 @@ pci_driver_handle_new_id(const char *path)
} }
ret = 0; ret = 0;
cleanup: cleanup:
return ret; return ret;
} }
@ -761,7 +761,7 @@ pci_driver_handle_remove_id(const char *path)
} }
ret = 0; ret = 0;
cleanup: cleanup:
return ret; return ret;
} }

View File

@ -52,7 +52,7 @@ testVirPCIDeviceCheckDriver(virPCIDevicePtr dev, const char *expected)
} }
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(path); VIR_FREE(path);
VIR_FREE(driver); VIR_FREE(driver);
return ret; return ret;
@ -77,7 +77,7 @@ testVirPCIDeviceNew(const void *opaque ATTRIBUTE_UNUSED)
} }
ret = 0; ret = 0;
cleanup: cleanup:
virPCIDeviceFree(dev); virPCIDeviceFree(dev);
return ret; return ret;
} }
@ -122,7 +122,7 @@ testVirPCIDeviceDetach(const void *oaque ATTRIBUTE_UNUSED)
} }
ret = 0; ret = 0;
cleanup: cleanup:
for (i = 0; i < nDev; i++) for (i = 0; i < nDev; i++)
virPCIDeviceFree(dev[i]); virPCIDeviceFree(dev[i]);
virObjectUnref(activeDevs); virObjectUnref(activeDevs);
@ -156,7 +156,7 @@ testVirPCIDeviceReset(const void *opaque ATTRIBUTE_UNUSED)
} }
ret = 0; ret = 0;
cleanup: cleanup:
for (i = 0; i < nDev; i++) for (i = 0; i < nDev; i++)
virPCIDeviceFree(dev[i]); virPCIDeviceFree(dev[i]);
virObjectUnref(activeDevs); virObjectUnref(activeDevs);
@ -205,7 +205,7 @@ testVirPCIDeviceReattach(const void *opaque ATTRIBUTE_UNUSED)
} }
ret = 0; ret = 0;
cleanup: cleanup:
virObjectUnref(activeDevs); virObjectUnref(activeDevs);
virObjectUnref(inactiveDevs); virObjectUnref(inactiveDevs);
return ret; return ret;
@ -233,7 +233,7 @@ testVirPCIDeviceIsAssignable(const void *opaque)
ret = 0; ret = 0;
virPCIDeviceFree(dev); virPCIDeviceFree(dev);
cleanup: cleanup:
return ret; return ret;
} }
@ -253,7 +253,7 @@ testVirPCIDeviceDetachSingle(const void *opaque)
goto cleanup; goto cleanup;
ret = 0; ret = 0;
cleanup: cleanup:
virPCIDeviceFree(dev); virPCIDeviceFree(dev);
return ret; return ret;
} }
@ -284,7 +284,7 @@ testVirPCIDeviceDetachFail(const void *opaque)
virPCIDeviceGetStubDriver(dev)); virPCIDeviceGetStubDriver(dev));
} }
cleanup: cleanup:
virPCIDeviceFree(dev); virPCIDeviceFree(dev);
return ret; return ret;
} }
@ -305,7 +305,7 @@ testVirPCIDeviceReattachSingle(const void *opaque)
goto cleanup; goto cleanup;
ret = 0; ret = 0;
cleanup: cleanup:
virPCIDeviceFree(dev); virPCIDeviceFree(dev);
return ret; return ret;
} }
@ -325,7 +325,7 @@ testVirPCIDeviceCheckDriverTest(const void *opaque)
goto cleanup; goto cleanup;
ret = 0; ret = 0;
cleanup: cleanup:
virPCIDeviceFree(dev); virPCIDeviceFree(dev);
return ret; return ret;
} }
@ -345,7 +345,7 @@ testVirPCIDeviceUnbind(const void *opaque)
goto cleanup; goto cleanup;
ret = 0; ret = 0;
cleanup: cleanup:
virPCIDeviceFree(dev); virPCIDeviceFree(dev);
return ret; return ret;
} }

View File

@ -184,7 +184,7 @@ static int testAllocAll(const void *args ATTRIBUTE_UNUSED)
} }
ret = 0; ret = 0;
cleanup: cleanup:
virObjectUnref(alloc); virObjectUnref(alloc);
return ret; return ret;
} }
@ -237,7 +237,7 @@ static int testAllocReuse(const void *args ATTRIBUTE_UNUSED)
} }
ret = 0; ret = 0;
cleanup: cleanup:
virObjectUnref(alloc); virObjectUnref(alloc);
return ret; return ret;
} }

View File

@ -47,7 +47,7 @@ test1(const void *data ATTRIBUTE_UNUSED)
goto cleanup; goto cleanup;
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(name); VIR_FREE(name);
return ret; return ret;
} }
@ -151,7 +151,7 @@ test2(const void *data ATTRIBUTE_UNUSED)
goto cleanup; goto cleanup;
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(sgname); VIR_FREE(sgname);
if (free_dev) if (free_dev)
virSCSIDeviceFree(dev); virSCSIDeviceFree(dev);
@ -180,7 +180,7 @@ mymain(void)
if (virtTestRun("test2", test2, NULL) < 0) if (virtTestRun("test2", test2, NULL) < 0)
ret = -1; ret = -1;
cleanup: cleanup:
VIR_FREE(virscsi_prefix); VIR_FREE(virscsi_prefix);
return ret; return ret;
} }

View File

@ -78,7 +78,7 @@ testCompareOutputLit(const char *expectData,
result = 0; result = 0;
cleanup: cleanup:
VIR_FREE(actualData); VIR_FREE(actualData);
return result; return result;

View File

@ -186,14 +186,14 @@ testPrepImages(void)
#endif #endif
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(buf); VIR_FREE(buf);
virCommandFree(cmd); virCommandFree(cmd);
if (ret) if (ret)
testCleanupImages(); testCleanupImages();
return ret; return ret;
skip: skip:
fputs("qemu-img is too old; skipping this test\n", stderr); fputs("qemu-img is too old; skipping this test\n", stderr);
ret = EXIT_AM_SKIP; ret = EXIT_AM_SKIP;
goto cleanup; goto cleanup;
@ -306,7 +306,7 @@ testStorageChain(const void *args)
} }
ret = 0; ret = 0;
cleanup: cleanup:
virStorageFileFreeMetadata(meta); virStorageFileFreeMetadata(meta);
return ret; return ret;
} }

View File

@ -80,7 +80,7 @@ static int testSplit(const void *args)
} }
ret = 0; ret = 0;
cleanup: cleanup:
virStringFreeList(got); virStringFreeList(got);
return ret; return ret;
@ -103,7 +103,7 @@ static int testJoin(const void *args)
} }
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(got); VIR_FREE(got);
return ret; return ret;
@ -192,7 +192,7 @@ testStrdup(const void *data ATTRIBUTE_UNUSED)
} }
ret = 0; ret = 0;
cleanup: cleanup:
for (i = 0; i < ARRAY_CARDINALITY(array); i++) for (i = 0; i < ARRAY_CARDINALITY(array); i++)
VIR_FREE(array[i]); VIR_FREE(array[i]);
return ret; return ret;
@ -228,7 +228,7 @@ testStrndupNegative(const void *opaque ATTRIBUTE_UNUSED)
} }
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(dst); VIR_FREE(dst);
return ret; return ret;
} }

View File

@ -130,7 +130,7 @@ static int testURIParse(const void *args)
} }
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(uristr); VIR_FREE(uristr);
virURIFree(uri); virURIFree(uri);
return ret; return ret;

View File

@ -64,7 +64,7 @@ static char *get_fake_path(const char *real_path)
return path; return path;
error: error:
errno = ENOMEM; errno = ENOMEM;
return NULL; return NULL;
} }

View File

@ -127,7 +127,7 @@ static int testDeviceFind(const void *opaque)
ret = 0; ret = 0;
cleanup: cleanup:
virObjectUnref(devs); virObjectUnref(devs);
virUSBDeviceFree(dev); virUSBDeviceFree(dev);
return ret; return ret;
@ -226,7 +226,7 @@ testUSBList(const void *opaque ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virObjectUnref(list); virObjectUnref(list);
virObjectUnref(devlist); virObjectUnref(devlist);
virUSBDeviceFree(dev); virUSBDeviceFree(dev);

View File

@ -66,7 +66,7 @@ testVerStrParse(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(path); VIR_FREE(path);
VIR_FREE(databuf); VIR_FREE(databuf);
return ret; return ret;

View File

@ -65,7 +65,7 @@ testCapsInit(void)
return; return;
failure: failure:
virObjectUnref(caps); virObjectUnref(caps);
caps = NULL; caps = NULL;
} }
@ -103,7 +103,7 @@ testCompareFiles(const char *vmx, const char *xml)
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(vmxData); VIR_FREE(vmxData);
VIR_FREE(xmlData); VIR_FREE(xmlData);
VIR_FREE(formatted); VIR_FREE(formatted);
@ -134,7 +134,7 @@ testCompareHelper(const void *data)
ret = testCompareFiles(vmx, xml); ret = testCompareFiles(vmx, xml);
cleanup: cleanup:
VIR_FREE(vmx); VIR_FREE(vmx);
VIR_FREE(xml); VIR_FREE(xml);
@ -178,7 +178,7 @@ testParseVMXFileName(const char *fileName, void *opaque ATTRIBUTE_UNUSED)
goto cleanup; goto cleanup;
} }
cleanup: cleanup:
VIR_FREE(copyOfFileName); VIR_FREE(copyOfFileName);
return src; return src;

View File

@ -188,7 +188,7 @@ testCompareHelper(const void *data)
else else
result = testCompareFormatXML(cfg, xml, info->version); result = testCompareFormatXML(cfg, xml, info->version);
cleanup: cleanup:
VIR_FREE(xml); VIR_FREE(xml);
VIR_FREE(cfg); VIR_FREE(cfg);

View File

@ -88,7 +88,7 @@ testCompareHelper(const void *data)
result = testCompareFiles(xml, args, info->version); result = testCompareFiles(xml, args, info->version);
cleanup: cleanup:
VIR_FREE(xml); VIR_FREE(xml);
VIR_FREE(args); VIR_FREE(args);

View File

@ -66,7 +66,7 @@ testCapsInit(void)
return; return;
failure: failure:
virObjectUnref(caps); virObjectUnref(caps);
virObjectUnref(xmlopt); virObjectUnref(xmlopt);
caps = NULL; caps = NULL;
@ -115,7 +115,7 @@ testCompareFiles(const char *xml, const char *vmx, int virtualHW_version)
result = 0; result = 0;
failure: failure:
VIR_FREE(xmlData); VIR_FREE(xmlData);
VIR_FREE(vmxData); VIR_FREE(vmxData);
VIR_FREE(formatted); VIR_FREE(formatted);
@ -147,7 +147,7 @@ testCompareHelper(const void *data)
result = testCompareFiles(xml, vmx, info->virtualHW_version); result = testCompareFiles(xml, vmx, info->virtualHW_version);
cleanup: cleanup:
VIR_FREE(xml); VIR_FREE(xml);
VIR_FREE(vmx); VIR_FREE(vmx);
@ -206,7 +206,7 @@ testFormatVMXFileName(const char *src, void *opaque ATTRIBUTE_UNUSED)
success = true; success = true;
cleanup: cleanup:
if (! success) { if (! success) {
VIR_FREE(absolutePath); VIR_FREE(absolutePath);
} }