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

conf: Replace virDomainDiskSourceParse by virDomainStorageSourceParse

virDomainDiskSourceParse was now just a thin wrapper without any extra
value. Replace all usage of it by the function it calls and remove the
function.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 54fc720d
......@@ -9111,20 +9111,6 @@ virDomainStorageSourceParse(xmlNodePtr node,
}
int
virDomainDiskSourceParse(xmlNodePtr node,
xmlXPathContextPtr ctxt,
virStorageSourcePtr src,
unsigned int flags,
virDomainXMLOptionPtr xmlopt)
{
if (virDomainStorageSourceParse(node, ctxt, src, flags, xmlopt) < 0)
return -1;
return 0;
}
static int
virDomainDiskBackingStoreParse(xmlXPathContextPtr ctxt,
virStorageSourcePtr src,
......@@ -9186,7 +9172,7 @@ virDomainDiskBackingStoreParse(xmlXPathContextPtr ctxt,
return -1;
}
if (virDomainDiskSourceParse(source, ctxt, backingStore, flags, xmlopt) < 0 ||
if (virDomainStorageSourceParse(source, ctxt, backingStore, flags, xmlopt) < 0 ||
virDomainDiskBackingStoreParse(ctxt, backingStore, flags, xmlopt) < 0)
return -1;
......@@ -9320,8 +9306,8 @@ virDomainDiskDefMirrorParse(virDomainDiskDefPtr def,
return -1;
}
if (virDomainDiskSourceParse(mirrorNode, ctxt, def->mirror,
flags, xmlopt) < 0)
if (virDomainStorageSourceParse(mirrorNode, ctxt, def->mirror,
flags, xmlopt) < 0)
return -1;
} else {
/* For back-compat reasons, we handle a file name
......@@ -9771,7 +9757,7 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
continue;
if (!source && virXMLNodeNameEqual(cur, "source")) {
if (virDomainDiskSourceParse(cur, ctxt, def->src, flags, xmlopt) < 0)
if (virDomainStorageSourceParse(cur, ctxt, def->src, flags, xmlopt) < 0)
goto error;
/* If we've already found an <auth> as a child of <disk> and
......
......@@ -3067,11 +3067,6 @@ virDomainDiskDefPtr
virDomainDiskRemove(virDomainDefPtr def, size_t i);
virDomainDiskDefPtr
virDomainDiskRemoveByName(virDomainDefPtr def, const char *name);
int virDomainDiskSourceParse(xmlNodePtr node,
xmlXPathContextPtr ctxt,
virStorageSourcePtr src,
unsigned int flags,
virDomainXMLOptionPtr xmlopt);
int virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net);
virDomainNetDefPtr virDomainNetFind(virDomainDefPtr def, const char *device);
......
......@@ -146,7 +146,7 @@ virDomainSnapshotDiskDefParseXML(xmlNodePtr node,
}
if ((cur = virXPathNode("./source", ctxt)) &&
virDomainDiskSourceParse(cur, ctxt, def->src, flags, xmlopt) < 0)
virDomainStorageSourceParse(cur, ctxt, def->src, flags, xmlopt) < 0)
goto cleanup;
if ((driver = virXPathString("string(./driver/@type)", ctxt)) &&
......
......@@ -62,7 +62,7 @@ testBackingXMLjsonXML(const void *args)
if (!(xml = virXMLParseStringCtxt(data->xml, "(test storage source XML)", &ctxt)))
return -1;
if (virDomainDiskSourceParse(ctxt->node, ctxt, xmlsrc, 0, NULL) < 0) {
if (virDomainStorageSourceParse(ctxt->node, ctxt, xmlsrc, 0, NULL) < 0) {
fprintf(stderr, "failed to parse disk source xml\n");
return -1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册