Re: [libvirt-glib 1/2] Add gvir_gconfig_object_remove_attribute helper

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

 



On Tue, Jan 3, 2012 at 11:08 AM, Christophe Fergeau <cfergeau@xxxxxxxxxx> wrote:
> ---
>  libvirt-gconfig/libvirt-gconfig-object-private.h |    2 ++
>  libvirt-gconfig/libvirt-gconfig-object.c         |   11 +++++++++++
>  2 files changed, 13 insertions(+), 0 deletions(-)
>
> diff --git a/libvirt-gconfig/libvirt-gconfig-object-private.h b/libvirt-gconfig/libvirt-gconfig-object-private.h
> index ea06a67..38c129f 100644
> --- a/libvirt-gconfig/libvirt-gconfig-object-private.h
> +++ b/libvirt-gconfig/libvirt-gconfig-object-private.h
> @@ -64,6 +64,8 @@ void gvir_config_object_set_attribute(GVirConfigObject *object,
>                                       ...) G_GNUC_NULL_TERMINATED;
>  void gvir_config_object_set_attribute_with_type(GVirConfigObject *object,
>                                                 ...) G_GNUC_NULL_TERMINATED;
> +void gvir_config_object_remove_attribute(GVirConfigObject *object,
> +                                         const char *attr_name);
>
>  G_END_DECLS
>
> diff --git a/libvirt-gconfig/libvirt-gconfig-object.c b/libvirt-gconfig/libvirt-gconfig-object.c
> index a75db6e..52a2a0d 100644
> --- a/libvirt-gconfig/libvirt-gconfig-object.c
> +++ b/libvirt-gconfig/libvirt-gconfig-object.c
> @@ -680,3 +680,14 @@ gvir_config_object_attach(GVirConfigObject *parent, GVirConfigObject *child)
>         child->priv->doc = g_object_ref(G_OBJECT(parent->priv->doc));
>     }
>  }
> +
> +G_GNUC_INTERNAL void
> +gvir_config_object_remove_attribute(GVirConfigObject *object,
> +                                    const char *attr_name)
> +{
> +    int status;
> +
> +    do {
> +        status = xmlUnsetProp(object->priv->node, (xmlChar *)attr_name);
> +    } while (status == 0);
> +}

  Looks good so ACK.

-- 
Regards,

Zeeshan Ali (Khattak)
FSF member#5124

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