mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 17:34:18 +03:00
xml: Clean up rest of virtual XML document names for XML strings
Commit498d783
cleans up some of virtual file names for parsing strings in memory. This patch cleans up (hopefuly) the rest forgotten by the first patch. This patch also changes all of the previously modified "filenames" to valid URI's replacing spaces for underscores. Changes to v1: - Replace all spaces for underscores, so that the strings form valid URI's - Replace spaces in places changed by commit498d783
This commit is contained in:
parent
9d0ae85088
commit
b998f1f77c
@ -5739,7 +5739,7 @@ virDomainDeviceDefPtr virDomainDeviceDefParse(virCapsPtr caps,
|
||||
xmlXPathContextPtr ctxt = NULL;
|
||||
virDomainDeviceDefPtr dev = NULL;
|
||||
|
||||
if (!(xml = virXMLParseStringCtxt(xmlStr, "device.xml", &ctxt))) {
|
||||
if (!(xml = virXMLParseStringCtxt(xmlStr, _("(device_definition)"), &ctxt))) {
|
||||
goto error;
|
||||
}
|
||||
node = ctxt->node;
|
||||
@ -7461,7 +7461,7 @@ virDomainDefParse(const char *xmlStr,
|
||||
xmlDocPtr xml;
|
||||
virDomainDefPtr def = NULL;
|
||||
|
||||
if ((xml = virXMLParse(filename, xmlStr, _("(domain definition)")))) {
|
||||
if ((xml = virXMLParse(filename, xmlStr, _("(domain_definition)")))) {
|
||||
def = virDomainDefParseNode(caps, xml, xmlDocGetRootElement(xml),
|
||||
expectedVirtTypes, flags);
|
||||
xmlFreeDoc(xml);
|
||||
@ -11573,7 +11573,7 @@ virDomainSnapshotDefParseString(const char *xmlStr,
|
||||
int active;
|
||||
char *tmp;
|
||||
|
||||
xml = virXMLParseCtxt(NULL, xmlStr, "domainsnapshot.xml", &ctxt);
|
||||
xml = virXMLParseCtxt(NULL, xmlStr, _("(domain_snapshot)"), &ctxt);
|
||||
if (!xml) {
|
||||
return NULL;
|
||||
}
|
||||
|
@ -864,7 +864,7 @@ virInterfaceDefParse(const char *xmlStr,
|
||||
xmlDocPtr xml;
|
||||
virInterfaceDefPtr def = NULL;
|
||||
|
||||
if ((xml = virXMLParse(filename, xmlStr, "interface.xml"))) {
|
||||
if ((xml = virXMLParse(filename, xmlStr, _("(interface_definition)")))) {
|
||||
def = virInterfaceDefParseNode(xml, xmlDocGetRootElement(xml));
|
||||
xmlFreeDoc(xml);
|
||||
}
|
||||
|
@ -1084,7 +1084,7 @@ virNetworkDefParse(const char *xmlStr,
|
||||
xmlDocPtr xml;
|
||||
virNetworkDefPtr def = NULL;
|
||||
|
||||
if ((xml = virXMLParse(filename, xmlStr, "network.xml"))) {
|
||||
if ((xml = virXMLParse(filename, xmlStr, _("(network_definition)")))) {
|
||||
def = virNetworkDefParseNode(xml, xmlDocGetRootElement(xml));
|
||||
xmlFreeDoc(xml);
|
||||
}
|
||||
|
@ -1231,7 +1231,7 @@ virNodeDeviceDefParse(const char *str,
|
||||
xmlDocPtr xml;
|
||||
virNodeDeviceDefPtr def = NULL;
|
||||
|
||||
if ((xml = virXMLParse(filename, str, "device.xml"))) {
|
||||
if ((xml = virXMLParse(filename, str, _("(node_device_definition)")))) {
|
||||
def = virNodeDeviceDefParseNode(xml, xmlDocGetRootElement(xml), create);
|
||||
xmlFreeDoc(xml);
|
||||
}
|
||||
|
@ -2119,7 +2119,7 @@ virNWFilterDefParse(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
virNWFilterDefPtr def = NULL;
|
||||
xmlDocPtr xml;
|
||||
|
||||
if ((xml = virXMLParse(filename, xmlStr, "nwfilter.xml"))) {
|
||||
if ((xml = virXMLParse(filename, xmlStr, _("(nwfilter_definition")))) {
|
||||
def = virNWFilterDefParseNode(xml, xmlDocGetRootElement(xml));
|
||||
xmlFreeDoc(xml);
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ virSecretDefParse(const char *xmlStr,
|
||||
xmlDocPtr xml;
|
||||
virSecretDefPtr ret = NULL;
|
||||
|
||||
if ((xml = virXMLParse(filename, xmlStr, "secret.xml"))) {
|
||||
if ((xml = virXMLParse(filename, xmlStr, _("(definition_of_secret)")))) {
|
||||
ret = secretXMLParseNode(xml, xmlDocGetRootElement(xml));
|
||||
xmlFreeDoc(xml);
|
||||
}
|
||||
|
@ -505,7 +505,7 @@ virStoragePoolDefParseSourceString(const char *srcSpec,
|
||||
xmlXPathContextPtr xpath_ctxt = NULL;
|
||||
virStoragePoolSourcePtr def = NULL, ret = NULL;
|
||||
|
||||
if (!(doc = virXMLParseStringCtxt(srcSpec, "srcSpec.xml", &xpath_ctxt))) {
|
||||
if (!(doc = virXMLParseStringCtxt(srcSpec, _("(storage_source_specification)"), &xpath_ctxt))) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@ -765,7 +765,7 @@ virStoragePoolDefParse(const char *xmlStr,
|
||||
virStoragePoolDefPtr ret = NULL;
|
||||
xmlDocPtr xml;
|
||||
|
||||
if ((xml = virXMLParse(filename, xmlStr, "storage.xml"))) {
|
||||
if ((xml = virXMLParse(filename, xmlStr, _("(storage_pool_definition)")))) {
|
||||
ret = virStoragePoolDefParseNode(xml, xmlDocGetRootElement(xml));
|
||||
xmlFreeDoc(xml);
|
||||
}
|
||||
@ -1146,7 +1146,7 @@ virStorageVolDefParse(virStoragePoolDefPtr pool,
|
||||
virStorageVolDefPtr ret = NULL;
|
||||
xmlDocPtr xml;
|
||||
|
||||
if ((xml = virXMLParse(filename, xmlStr, "storage.xml"))) {
|
||||
if ((xml = virXMLParse(filename, xmlStr, _("(storage_volume_definition)")))) {
|
||||
ret = virStorageVolDefParseNode(pool, xml, xmlDocGetRootElement(xml));
|
||||
xmlFreeDoc(xml);
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ cpuCompareXML(virCPUDefPtr host,
|
||||
|
||||
VIR_DEBUG("host=%p, xml=%s", host, NULLSTR(xml));
|
||||
|
||||
if (!(doc = virXMLParseStringCtxt(xml, "cpu.xml", &ctxt)))
|
||||
if (!(doc = virXMLParseStringCtxt(xml, _("(CPU_definition)"), &ctxt)))
|
||||
goto cleanup;
|
||||
|
||||
cpu = virCPUDefParseXML(ctxt->node, ctxt, VIR_CPU_TYPE_AUTO);
|
||||
@ -304,7 +304,7 @@ cpuBaselineXML(const char **xmlCPUs,
|
||||
goto no_memory;
|
||||
|
||||
for (i = 0; i < ncpus; i++) {
|
||||
if (!(doc = virXMLParseStringCtxt(xmlCPUs[i], "cpu.xml", &ctxt)))
|
||||
if (!(doc = virXMLParseStringCtxt(xmlCPUs[i], _("(CPU_definition)"), &ctxt)))
|
||||
goto error;
|
||||
|
||||
cpus[i] = virCPUDefParseXML(ctxt->node, ctxt, VIR_CPU_TYPE_HOST);
|
||||
|
@ -911,7 +911,7 @@ esxVI_Context_Execute(esxVI_Context *ctx, const char *methodName,
|
||||
|
||||
if ((*response)->responseCode == 500 || (*response)->responseCode == 200) {
|
||||
(*response)->document = virXMLParseStringCtxt((*response)->content,
|
||||
"esx.xml",
|
||||
_("(esx execute response)"),
|
||||
&xpathContext);
|
||||
|
||||
if ((*response)->document == NULL) {
|
||||
|
@ -603,7 +603,7 @@ qemuMigrationCookieXMLParseStr(qemuMigrationCookiePtr mig,
|
||||
|
||||
VIR_DEBUG("xml=%s", NULLSTR(xml));
|
||||
|
||||
if (!(doc = virXMLParseStringCtxt(xml, "qemumigration.xml", &ctxt)))
|
||||
if (!(doc = virXMLParseStringCtxt(xml, _("(qemu_migration_cookie)"), &ctxt)))
|
||||
goto cleanup;
|
||||
|
||||
ret = qemuMigrationCookieXMLParse(mig, ctxt, flags);
|
||||
|
@ -641,7 +641,7 @@ caps_mockup(vahControl * ctl, const char *xmlStr)
|
||||
xmlDocPtr xml = NULL;
|
||||
xmlXPathContextPtr ctxt = NULL;
|
||||
|
||||
if (!(xml = virXMLParseStringCtxt(xmlStr, _("(domain definition)"),
|
||||
if (!(xml = virXMLParseStringCtxt(xmlStr, _("(domain_definition)"),
|
||||
&ctxt))) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -1307,7 +1307,7 @@ cmdDomIfSetLink (vshControl *ctl, const vshCmd *cmd)
|
||||
flags = VIR_DOMAIN_AFFECT_CONFIG;
|
||||
|
||||
/* extract current network device description */
|
||||
xml = virXMLParseStringCtxt(desc, _("(domain definition)"), &ctxt);
|
||||
xml = virXMLParseStringCtxt(desc, _("(domain_definition)"), &ctxt);
|
||||
VIR_FREE(desc);
|
||||
if (!xml) {
|
||||
vshError(ctl, _("Failed to parse domain description xml"));
|
||||
@ -1454,7 +1454,7 @@ cmdDomIfGetLink (vshControl *ctl, const vshCmd *cmd)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
xml = virXMLParseStringCtxt(desc, _("(domain definition)"), &ctxt);
|
||||
xml = virXMLParseStringCtxt(desc, _("(domain_definition)"), &ctxt);
|
||||
VIR_FREE(desc);
|
||||
if (!xml) {
|
||||
vshError(ctl, _("Failed to parse domain description xml"));
|
||||
@ -1663,7 +1663,7 @@ cmdDomblklist(vshControl *ctl, const vshCmd *cmd)
|
||||
if (!xml)
|
||||
goto cleanup;
|
||||
|
||||
xmldoc = virXMLParseStringCtxt(xml, _("(domain definition)"), &ctxt);
|
||||
xmldoc = virXMLParseStringCtxt(xml, _("(domain_definition)"), &ctxt);
|
||||
if (!xmldoc)
|
||||
goto cleanup;
|
||||
|
||||
@ -9042,7 +9042,7 @@ makeCloneXML(const char *origxml, const char *newname)
|
||||
xmlChar *newxml = NULL;
|
||||
int size;
|
||||
|
||||
doc = virXMLParseStringCtxt(origxml, _("(volume definition)"), &ctxt);
|
||||
doc = virXMLParseStringCtxt(origxml, _("(volume_definition)"), &ctxt);
|
||||
if (!doc)
|
||||
goto cleanup;
|
||||
|
||||
@ -10833,7 +10833,7 @@ cmdVNCDisplay(vshControl *ctl, const vshCmd *cmd)
|
||||
if (!doc)
|
||||
goto cleanup;
|
||||
|
||||
xml = virXMLParseStringCtxt(doc, _("(domain definition)"), &ctxt);
|
||||
xml = virXMLParseStringCtxt(doc, _("(domain_definition)"), &ctxt);
|
||||
VIR_FREE(doc);
|
||||
if (!xml)
|
||||
goto cleanup;
|
||||
@ -10901,7 +10901,7 @@ cmdTTYConsole(vshControl *ctl, const vshCmd *cmd)
|
||||
if (!doc)
|
||||
goto cleanup;
|
||||
|
||||
xml = virXMLParseStringCtxt(doc, _("(domain definition)"), &ctxt);
|
||||
xml = virXMLParseStringCtxt(doc, _("(domain_definition)"), &ctxt);
|
||||
VIR_FREE(doc);
|
||||
if (!xml)
|
||||
goto cleanup;
|
||||
@ -11288,7 +11288,7 @@ cmdDetachInterface(vshControl *ctl, const vshCmd *cmd)
|
||||
if (!doc)
|
||||
goto cleanup;
|
||||
|
||||
xml = virXMLParseStringCtxt(doc, _("(domain definition)"), &ctxt);
|
||||
xml = virXMLParseStringCtxt(doc, _("(domain_definition)"), &ctxt);
|
||||
VIR_FREE(doc);
|
||||
if (!xml) {
|
||||
vshError(ctl, "%s", _("Failed to get interface information"));
|
||||
@ -11755,7 +11755,7 @@ cmdDetachDisk(vshControl *ctl, const vshCmd *cmd)
|
||||
if (!doc)
|
||||
goto cleanup;
|
||||
|
||||
xml = virXMLParseStringCtxt(doc, _("(domain definition)"), &ctxt);
|
||||
xml = virXMLParseStringCtxt(doc, _("(domain_definition)"), &ctxt);
|
||||
VIR_FREE(doc);
|
||||
if (!xml) {
|
||||
vshError(ctl, "%s", _("Failed to get disk information"));
|
||||
@ -13025,7 +13025,7 @@ cmdSnapshotList(vshControl *ctl, const vshCmd *cmd)
|
||||
if (!doc)
|
||||
continue;
|
||||
|
||||
xml = virXMLParseStringCtxt(doc, _("(domain snapshot)"), &ctxt);
|
||||
xml = virXMLParseStringCtxt(doc, _("(domain_snapshot)"), &ctxt);
|
||||
if (!xml)
|
||||
continue;
|
||||
|
||||
@ -13186,7 +13186,7 @@ cmdSnapshotParent(vshControl *ctl, const vshCmd *cmd)
|
||||
if (!xml)
|
||||
goto cleanup;
|
||||
|
||||
xmldoc = virXMLParseStringCtxt(xml, _("(domain snapshot)"), &ctxt);
|
||||
xmldoc = virXMLParseStringCtxt(xml, _("(domain_snapshot)"), &ctxt);
|
||||
if (!xmldoc)
|
||||
goto cleanup;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user