ack On Wed, Nov 9, 2011 at 9:48 PM, Christophe Fergeau <cfergeau@xxxxxxxxxx> wrote: > It's not enough to assign xmlDocPtr::children to set the > document root, xmlDocSetRootElement must be used instead. > --- > libvirt-gconfig/libvirt-gconfig-object.c | 6 ++++-- > 1 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/libvirt-gconfig/libvirt-gconfig-object.c b/libvirt-gconfig/libvirt-gconfig-object.c > index adbd955..fbdbedd 100644 > --- a/libvirt-gconfig/libvirt-gconfig-object.c > +++ b/libvirt-gconfig/libvirt-gconfig-object.c > @@ -378,11 +378,13 @@ GVirConfigObject *gvir_config_object_new(GType type, > const char *schema) > { > xmlDocPtr doc; > + xmlNodePtr node; > > doc = xmlNewDoc((xmlChar *)"1.0"); > - doc->children = xmlNewDocNode(doc, NULL, (xmlChar *)root_name, NULL); > + node = xmlNewDocNode(doc, NULL, (xmlChar *)root_name, NULL); > + xmlDocSetRootElement(doc, node); > return GVIR_CONFIG_OBJECT(g_object_new(type, > - "node", doc->children, > + "node", node, > "schema", schema, > NULL)); > } > -- > 1.7.7 > > -- > libvir-list mailing list > libvir-list@xxxxxxxxxx > https://www.redhat.com/mailman/listinfo/libvir-list > -- Marc-André Lureau -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list