Re: [libvirt-glib 2/3] Fix creation of empty XML document

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

 



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



[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]