Re: [libvirt-glib 1/7] Fix gvir_config_object_new_from_xml error reporting

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

 



On Mon, Feb 06, 2012 at 12:56:11PM +0100, Christophe Fergeau wrote:
> It's currently failing to report parsing errors if the passed in
> error is NULL.
> ---
>  libvirt-gconfig/libvirt-gconfig-object.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/libvirt-gconfig/libvirt-gconfig-object.c b/libvirt-gconfig/libvirt-gconfig-object.c
> index 2e28208..7e3cb88 100644
> --- a/libvirt-gconfig/libvirt-gconfig-object.c
> +++ b/libvirt-gconfig/libvirt-gconfig-object.c
> @@ -636,10 +636,13 @@ GVirConfigObject *gvir_config_object_new_from_xml(GType type,
>      GVirConfigObject *object;
>      GVirConfigXmlDoc *doc;
>      xmlNodePtr node;
> +    GError *tmp_error = NULL;
>  
> -    node = gvir_config_xml_parse(xml, root_name, error);
> -    if ((error != NULL) && (*error != NULL))
> +    node = gvir_config_xml_parse(xml, root_name, &tmp_error);
> +    if (tmp_error != NULL) {
> +        g_propagate_error(error, tmp_error);
>          return NULL;
> +    }
>      doc = gvir_config_xml_doc_new(node->doc);
>      object = GVIR_CONFIG_OBJECT(g_object_new(type,
>                                               "doc", doc,

ACK


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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