[libvirt] [PATCH libvirt-glib v2 1/2] Add gvir_config_object_replace_child_with_attribute_enum()

Christophe Fergeau cfergeau at redhat.com
Thu Mar 14 15:32:38 UTC 2013


ACK
On Thu, Mar 14, 2013 at 03:53:46PM +0200, Zeeshan Ali (Khattak) wrote:
> From: "Zeeshan Ali (Khattak)" <zeeshanak at gnome.org>
> 
> Internal libvirt-gconfig helper to replace enum XML attributes.
> ---
>  libvirt-gconfig/libvirt-gconfig-object-private.h |  5 +++++
>  libvirt-gconfig/libvirt-gconfig-object.c         | 14 ++++++++++++++
>  2 files changed, 19 insertions(+)
> 
> diff --git a/libvirt-gconfig/libvirt-gconfig-object-private.h b/libvirt-gconfig/libvirt-gconfig-object-private.h
> index 830517c..91355fb 100644
> --- a/libvirt-gconfig/libvirt-gconfig-object-private.h
> +++ b/libvirt-gconfig/libvirt-gconfig-object-private.h
> @@ -74,6 +74,11 @@ void gvir_config_object_replace_child_with_attribute(GVirConfigObject *object,
>                                                       const char *child_name,
>                                                       const char *attr_name,
>                                                       const char *attr_value);
> +void gvir_config_object_replace_child_with_attribute_enum(GVirConfigObject *object,
> +                                                         const char *child_name,
> +                                                         const char *attr_name,
> +                                                         GType attr_type,
> +                                                         unsigned int attr_value);
>  void gvir_config_object_delete_child(GVirConfigObject *object,
>                                       const char *child_name,
>                                       const char *ns_href);
> diff --git a/libvirt-gconfig/libvirt-gconfig-object.c b/libvirt-gconfig/libvirt-gconfig-object.c
> index ac0545c..c4e4271 100644
> --- a/libvirt-gconfig/libvirt-gconfig-object.c
> +++ b/libvirt-gconfig/libvirt-gconfig-object.c
> @@ -459,6 +459,20 @@ gvir_config_object_replace_child_with_attribute(GVirConfigObject *object,
>      g_object_unref(G_OBJECT(child));
>  }
>  
> +G_GNUC_INTERNAL void
> +gvir_config_object_replace_child_with_attribute_enum(GVirConfigObject *object,
> +                                                     const char *child_name,
> +                                                     const char *attr_name,
> +                                                     GType attr_type,
> +                                                     unsigned int attr_value)
> +{
> +    GVirConfigObject *child;
> +
> +    child = gvir_config_object_replace_child(object, child_name);
> +    gvir_config_object_set_attribute_with_type(child, attr_name, attr_type, attr_value, NULL);
> +    g_object_unref(G_OBJECT(child));
> +}
> +
>  struct NodeMatch {
>      const char *name;
>      const char *ns;
> -- 
> 1.8.1.4
> 
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130314/6211480a/attachment-0001.sig>


More information about the libvir-list mailing list