mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
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: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
54fc720d8e
commit
dfaf170df5
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user