[PATCH v2] xml: Clean up rest of virtual XML document names for XML strings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit 498d783 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 commit 498d783
---
 src/conf/domain_conf.c        |    6 +++---
 src/conf/interface_conf.c     |    2 +-
 src/conf/network_conf.c       |    2 +-
 src/conf/node_device_conf.c   |    2 +-
 src/conf/nwfilter_conf.c      |    2 +-
 src/conf/secret_conf.c        |    2 +-
 src/conf/storage_conf.c       |    6 +++---
 src/cpu/cpu.c                 |    4 ++--
 src/esx/esx_vi.c              |    2 +-
 src/qemu/qemu_migration.c     |    2 +-
 src/security/virt-aa-helper.c |    2 +-
 tools/virsh.c                 |   20 ++++++++++----------
 12 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 11755fe..c4fbdd5 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -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;
     }
diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c
index 10377e7..fd8d1ae 100644
--- a/src/conf/interface_conf.c
+++ b/src/conf/interface_conf.c
@@ -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);
     }
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index e055094..b98ffad 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -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);
     }
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index 6b0ef50..fc284e0 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -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);
     }
diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c
index 04bfa22..08ede48 100644
--- a/src/conf/nwfilter_conf.c
+++ b/src/conf/nwfilter_conf.c
@@ -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);
     }
diff --git a/src/conf/secret_conf.c b/src/conf/secret_conf.c
index 105afbe..b33ce98 100644
--- a/src/conf/secret_conf.c
+++ b/src/conf/secret_conf.c
@@ -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);
     }
diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index 1e7da69..e893b2d 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -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);
     }
diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c
index b47f078..2906be9 100644
--- a/src/cpu/cpu.c
+++ b/src/cpu/cpu.c
@@ -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);
diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c
index f4033eb..2d9890c 100644
--- a/src/esx/esx_vi.c
+++ b/src/esx/esx_vi.c
@@ -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) {
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index f849d05..7fd4192 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -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);
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index b9e551a..66608f8 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -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;
     }
diff --git a/tools/virsh.c b/tools/virsh.c
index 430168c..3c6e65a 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -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;

-- 
1.7.3.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]