[libvirt] [libvirt-glib 09/23] Make the GVirConfigDomain::name property writable

Daniel P. Berrange berrange at redhat.com
Tue Oct 18 11:40:43 UTC 2011


On Fri, Oct 07, 2011 at 11:40:54AM +0200, Christophe Fergeau wrote:
> ---
>  libvirt-gconfig/libvirt-gconfig-domain.c |   19 ++++++++++++++++++-
>  1 files changed, 18 insertions(+), 1 deletions(-)
> 
> diff --git a/libvirt-gconfig/libvirt-gconfig-domain.c b/libvirt-gconfig/libvirt-gconfig-domain.c
> index 06fc3fa..00cab80 100644
> --- a/libvirt-gconfig/libvirt-gconfig-domain.c
> +++ b/libvirt-gconfig/libvirt-gconfig-domain.c
> @@ -63,6 +63,22 @@ static void gvir_config_domain_get_property(GObject *object,
>      }
>  }
>  
> +static void gvir_config_domain_set_property(GObject *object,
> +                                            guint prop_id,
> +                                            const GValue *value,
> +                                            GParamSpec *pspec)
> +{
> +    GVirConfigDomain *domain = GVIR_CONFIG_DOMAIN(object);
> +
> +    switch (prop_id) {
> +    case PROP_NAME:
> +        gvir_config_domain_set_name(domain, g_value_get_string(value));
> +        break;
> +    default:
> +        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
> +    }
> +}
> +
>  
>  static void gvir_config_domain_class_init(GVirConfigDomainClass *klass)
>  {
> @@ -71,6 +87,7 @@ static void gvir_config_domain_class_init(GVirConfigDomainClass *klass)
>      g_type_class_add_private(klass, sizeof(GVirConfigDomainPrivate));
>  
>      object_class->get_property = gvir_config_domain_get_property;
> +    object_class->set_property = gvir_config_domain_set_property;
>  
>      g_object_class_install_property(object_class,
>                                      PROP_NAME,
> @@ -78,7 +95,7 @@ static void gvir_config_domain_class_init(GVirConfigDomainClass *klass)
>                                                          "Name",
>                                                          "Domain Name",
>                                                          NULL,
> -                                                        G_PARAM_READABLE |
> +                                                        G_PARAM_READWRITE |
>                                                          G_PARAM_STATIC_STRINGS));
>  }

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




More information about the libvir-list mailing list