提交 8ba6dd13 编写于 作者: D Daniel Henrique Barboza 提交者: Erik Skultety

test/test_driver.c: remove unneeded labels

Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: NErik Skultety <eskultet@redhat.com>
上级 a7c024e2
...@@ -791,7 +791,7 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathContextPtr ctxt) ...@@ -791,7 +791,7 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathContextPtr ctxt)
} else if (ret == -2) { } else if (ret == -2) {
virReportError(VIR_ERR_XML_ERROR, "%s", virReportError(VIR_ERR_XML_ERROR, "%s",
_("invalid node cpu nodes value")); _("invalid node cpu nodes value"));
goto error; return -1;
} }
ret = virXPathLong("string(/node/cpu/sockets[1])", ctxt, &l); ret = virXPathLong("string(/node/cpu/sockets[1])", ctxt, &l);
...@@ -800,7 +800,7 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathContextPtr ctxt) ...@@ -800,7 +800,7 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathContextPtr ctxt)
} else if (ret == -2) { } else if (ret == -2) {
virReportError(VIR_ERR_XML_ERROR, "%s", virReportError(VIR_ERR_XML_ERROR, "%s",
_("invalid node cpu sockets value")); _("invalid node cpu sockets value"));
goto error; return -1;
} }
ret = virXPathLong("string(/node/cpu/cores[1])", ctxt, &l); ret = virXPathLong("string(/node/cpu/cores[1])", ctxt, &l);
...@@ -809,7 +809,7 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathContextPtr ctxt) ...@@ -809,7 +809,7 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathContextPtr ctxt)
} else if (ret == -2) { } else if (ret == -2) {
virReportError(VIR_ERR_XML_ERROR, "%s", virReportError(VIR_ERR_XML_ERROR, "%s",
_("invalid node cpu cores value")); _("invalid node cpu cores value"));
goto error; return -1;
} }
ret = virXPathLong("string(/node/cpu/threads[1])", ctxt, &l); ret = virXPathLong("string(/node/cpu/threads[1])", ctxt, &l);
...@@ -818,7 +818,7 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathContextPtr ctxt) ...@@ -818,7 +818,7 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathContextPtr ctxt)
} else if (ret == -2) { } else if (ret == -2) {
virReportError(VIR_ERR_XML_ERROR, "%s", virReportError(VIR_ERR_XML_ERROR, "%s",
_("invalid node cpu threads value")); _("invalid node cpu threads value"));
goto error; return -1;
} }
nodeInfo->cpus = (nodeInfo->cores * nodeInfo->threads * nodeInfo->cpus = (nodeInfo->cores * nodeInfo->threads *
...@@ -830,7 +830,7 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathContextPtr ctxt) ...@@ -830,7 +830,7 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathContextPtr ctxt)
} else if (ret == -2) { } else if (ret == -2) {
virReportError(VIR_ERR_XML_ERROR, "%s", virReportError(VIR_ERR_XML_ERROR, "%s",
_("invalid node cpu active value")); _("invalid node cpu active value"));
goto error; return -1;
} }
ret = virXPathLong("string(/node/cpu/mhz[1])", ctxt, &l); ret = virXPathLong("string(/node/cpu/mhz[1])", ctxt, &l);
if (ret == 0) { if (ret == 0) {
...@@ -838,7 +838,7 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathContextPtr ctxt) ...@@ -838,7 +838,7 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathContextPtr ctxt)
} else if (ret == -2) { } else if (ret == -2) {
virReportError(VIR_ERR_XML_ERROR, "%s", virReportError(VIR_ERR_XML_ERROR, "%s",
_("invalid node cpu mhz value")); _("invalid node cpu mhz value"));
goto error; return -1;
} }
str = virXPathString("string(/node/cpu/model[1])", ctxt); str = virXPathString("string(/node/cpu/model[1])", ctxt);
...@@ -846,7 +846,7 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathContextPtr ctxt) ...@@ -846,7 +846,7 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathContextPtr ctxt)
if (virStrcpyStatic(nodeInfo->model, str) < 0) { if (virStrcpyStatic(nodeInfo->model, str) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Model %s too big for destination"), str); _("Model %s too big for destination"), str);
goto error; return -1;
} }
} }
...@@ -856,12 +856,10 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathContextPtr ctxt) ...@@ -856,12 +856,10 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathContextPtr ctxt)
} else if (ret == -2) { } else if (ret == -2) {
virReportError(VIR_ERR_XML_ERROR, "%s", virReportError(VIR_ERR_XML_ERROR, "%s",
_("invalid node memory value")); _("invalid node memory value"));
goto error; return -1;
} }
return 0; return 0;
error:
return -1;
} }
static int static int
...@@ -871,7 +869,6 @@ testParseDomainSnapshots(testDriverPtr privconn, ...@@ -871,7 +869,6 @@ testParseDomainSnapshots(testDriverPtr privconn,
xmlXPathContextPtr ctxt) xmlXPathContextPtr ctxt)
{ {
size_t i; size_t i;
int ret = -1;
testDomainNamespaceDefPtr nsdata = domobj->def->namespaceData; testDomainNamespaceDefPtr nsdata = domobj->def->namespaceData;
xmlNodePtr *nodes = nsdata->snap_nodes; xmlNodePtr *nodes = nsdata->snap_nodes;
bool cur; bool cur;
...@@ -882,7 +879,7 @@ testParseDomainSnapshots(testDriverPtr privconn, ...@@ -882,7 +879,7 @@ testParseDomainSnapshots(testDriverPtr privconn,
xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file, xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file,
"domainsnapshot"); "domainsnapshot");
if (!node) if (!node)
goto error; return -1;
def = virDomainSnapshotDefParseNode(ctxt->doc, node, def = virDomainSnapshotDefParseNode(ctxt->doc, node,
privconn->xmlopt, privconn->xmlopt,
...@@ -892,18 +889,18 @@ testParseDomainSnapshots(testDriverPtr privconn, ...@@ -892,18 +889,18 @@ testParseDomainSnapshots(testDriverPtr privconn,
VIR_DOMAIN_SNAPSHOT_PARSE_INTERNAL | VIR_DOMAIN_SNAPSHOT_PARSE_INTERNAL |
VIR_DOMAIN_SNAPSHOT_PARSE_REDEFINE); VIR_DOMAIN_SNAPSHOT_PARSE_REDEFINE);
if (!def) if (!def)
goto error; return -1;
if (!(snap = virDomainSnapshotAssignDef(domobj->snapshots, def))) { if (!(snap = virDomainSnapshotAssignDef(domobj->snapshots, def))) {
virObjectUnref(def); virObjectUnref(def);
goto error; return -1;
} }
if (cur) { if (cur) {
if (virDomainSnapshotGetCurrent(domobj->snapshots)) { if (virDomainSnapshotGetCurrent(domobj->snapshots)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("more than one snapshot claims to be active")); _("more than one snapshot claims to be active"));
goto error; return -1;
} }
virDomainSnapshotSetCurrent(domobj->snapshots, snap); virDomainSnapshotSetCurrent(domobj->snapshots, snap);
...@@ -914,12 +911,10 @@ testParseDomainSnapshots(testDriverPtr privconn, ...@@ -914,12 +911,10 @@ testParseDomainSnapshots(testDriverPtr privconn,
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Snapshots have inconsistent relations for " _("Snapshots have inconsistent relations for "
"domain %s"), domobj->def->name); "domain %s"), domobj->def->name);
goto error; return -1;
} }
ret = 0; return 0;
error:
return ret;
} }
static int static int
...@@ -1236,27 +1231,25 @@ testOpenParse(testDriverPtr privconn, ...@@ -1236,27 +1231,25 @@ testOpenParse(testDriverPtr privconn,
if (!virXMLNodeNameEqual(ctxt->node, "node")) { if (!virXMLNodeNameEqual(ctxt->node, "node")) {
virReportError(VIR_ERR_XML_ERROR, "%s", virReportError(VIR_ERR_XML_ERROR, "%s",
_("Root element is not 'node'")); _("Root element is not 'node'"));
goto error; return -1;
} }
if (testParseNodeInfo(&privconn->nodeInfo, ctxt) < 0) if (testParseNodeInfo(&privconn->nodeInfo, ctxt) < 0)
goto error; return -1;
if (testParseDomains(privconn, file, ctxt) < 0) if (testParseDomains(privconn, file, ctxt) < 0)
goto error; return -1;
if (testParseNetworks(privconn, file, ctxt) < 0) if (testParseNetworks(privconn, file, ctxt) < 0)
goto error; return -1;
if (testParseInterfaces(privconn, file, ctxt) < 0) if (testParseInterfaces(privconn, file, ctxt) < 0)
goto error; return -1;
if (testParseStorage(privconn, file, ctxt) < 0) if (testParseStorage(privconn, file, ctxt) < 0)
goto error; return -1;
if (testParseNodedevs(privconn, file, ctxt) < 0) if (testParseNodedevs(privconn, file, ctxt) < 0)
goto error; return -1;
if (testParseAuthUsers(privconn, ctxt) < 0) if (testParseAuthUsers(privconn, ctxt) < 0)
goto error; return -1;
return 0; return 0;
error:
return -1;
} }
/* No shared state between simultaneous test connections initialized /* No shared state between simultaneous test connections initialized
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册