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

[libvirt PATCH 4/8] vbox: do not repeat the innotek namespace url



Also, remove the url from the translatable string,
reducing it to the generic message already used
by virXMLNamespaceRegister.

Signed-off-by: Ján Tomko <jtomko redhat com>
---
 src/vbox/vbox_snapshot_conf.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/vbox/vbox_snapshot_conf.c b/src/vbox/vbox_snapshot_conf.c
index ee644e1e2d..a18958fcc0 100644
--- a/src/vbox/vbox_snapshot_conf.c
+++ b/src/vbox/vbox_snapshot_conf.c
@@ -571,6 +571,8 @@ virVBoxSnapshotConfMachineFree(virVBoxSnapshotConfMachinePtr machine)
     VIR_FREE(machine);
 }
 
+#define VBOX_SETTINGS_NS "http://www.innotek.de/VirtualBox-settings";
+
 /*
  *vboxSnapshotLoadVboxFile: Create a vboxSnapshotXmlMachinePtr from a VirtualBoxl xml file.
  *return an initialized vboxSnapshotXmlMachinePtr on success
@@ -613,10 +615,10 @@ virVBoxSnapshotConfLoadVboxFile(const char *filePath,
 
     if (xmlXPathRegisterNs(xPathContext,
                            BAD_CAST "vbox",
-                           BAD_CAST "http://www.innotek.de/VirtualBox-settings";) < 0) {
-        virReportError(VIR_ERR_XML_ERROR, "%s",
-                       _("Failed to register xml namespace "
-                         "'http://www.innotek.de/VirtualBox-settings'"));
+                           BAD_CAST VBOX_SETTINGS_NS) < 0) {
+        virReportError(VIR_ERR_XML_ERROR,
+                       _("Failed to register xml namespace '%s'"),
+                       VBOX_SETTINGS_NS);
         goto cleanup;
     }
 
@@ -1015,7 +1017,7 @@ virVBoxSnapshotConfSaveVboxFile(virVBoxSnapshotConfMachinePtr machine,
     }
     if (xmlNewProp(cur,
                    BAD_CAST "xmlns",
-                   BAD_CAST "http://www.innotek.de/VirtualBox-settings";) == NULL) {
+                   BAD_CAST VBOX_SETTINGS_NS) == NULL) {
         virReportError(VIR_ERR_XML_ERROR, "%s",
                        _("Error in xmlNewProp"));
         goto cleanup;
-- 
2.26.2


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