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

Re: [libvirt] [libvirt-glib 3/7] Add gvir_config_xml_node_to_string helper



On Mon, Feb 06, 2012 at 12:02:23PM +0000, Daniel P. Berrange wrote:
> In gvir_config_object_to_xml() we pass '1' for the 'format' argument
> to get pretty-printed XML. Perhaps we should do the same here too ?

Sure, makes sense to be consistent.
Actually, we could even go with this followup patch:


diff --git a/libvirt-gconfig/libvirt-gconfig-object.c b/libvirt-gconfig/libvirt-gconfig-object.c
index a42b36c..662b8ed 100644
--- a/libvirt-gconfig/libvirt-gconfig-object.c
+++ b/libvirt-gconfig/libvirt-gconfig-object.c
@@ -256,21 +256,7 @@ void gvir_config_object_validate(GVirConfigObject *config,
 
 gchar *gvir_config_object_to_xml(GVirConfigObject *config)
 {
-    xmlChar *doc;
-    int size;
-    xmlNodePtr node;
-    gchar *output_doc;
-
-    node = gvir_config_object_get_xml_node(config);
-    if (node == NULL)
-        return NULL;
-
-    xmlDocDumpFormatMemory(node->doc, &doc, &size, 1);
-
-    output_doc = g_strdup((gchar *)doc);
-    xmlFree(doc);
-
-    return output_doc;
+    return gvir_config_xml_node_to_string(config->priv->node);
 }
 
 const gchar *gvir_config_object_get_schema(GVirConfigObject *config)

Christophe

Attachment: pgpcTrzz2gMKs.pgp
Description: PGP signature


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