Re: [libvirt-glib/libvirt-gconfig 11/17] gconfig: Adapt GVirConfigDomainGraphicsSpice to GVirConfigDomainGraphicsRemote

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

 



On Tue, Mar 22, 2016 at 11:04:47AM +0100, Fabiano Fidêncio wrote:
> This patch adapts GVirConfigDomainGraphicsSpice to the new
> GVirConfigDomainGraphicsRemote, inheriting from it and using its helper
> functions for getting autoport and port properties.
> 
> As GVirConfigDomainGraphicsSpice now inherits from
> GVirConfigDomainGraphicsRemote, this patch also introduces an ABI
> breakage.

I think one way of avoiding the biggest potential breakage would be to
not add padding to GVirConfigDomainGraphicsRemote, I think this would
not break classes inheriting from GVirConfigDomainGraphicsSpice.

Acked-by: Christophe Fergeau <cfergeau@xxxxxxxxxx>

> 
> Signed-off-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx>
> ---
>  libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.c | 11 ++++-------
>  libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.h |  4 ++--
>  2 files changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git a/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.c b/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.c
> index 38ee3e6..74466d0 100644
> --- a/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.c
> +++ b/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.c
> @@ -34,7 +34,7 @@ struct _GVirConfigDomainGraphicsSpicePrivate
>      gboolean unused;
>  };
>  
> -G_DEFINE_TYPE(GVirConfigDomainGraphicsSpice, gvir_config_domain_graphics_spice, GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS);
> +G_DEFINE_TYPE(GVirConfigDomainGraphicsSpice, gvir_config_domain_graphics_spice, GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_REMOTE);
>  
>  
>  static void gvir_config_domain_graphics_spice_class_init(GVirConfigDomainGraphicsSpiceClass *klass)
> @@ -78,8 +78,7 @@ gboolean gvir_config_domain_graphics_spice_get_autoport(GVirConfigDomainGraphics
>  {
>      g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN_GRAPHICS_SPICE(graphics), FALSE);
>  
> -    return gvir_config_object_get_attribute_boolean(GVIR_CONFIG_OBJECT(graphics),
> -                                                    NULL, "autoport", FALSE);
> +    return gvir_config_domain_graphics_remote_get_autoport(GVIR_CONFIG_DOMAIN_GRAPHICS_REMOTE(graphics));
>  }
>  
>  void gvir_config_domain_graphics_spice_set_autoport(GVirConfigDomainGraphicsSpice *graphics,
> @@ -106,8 +105,7 @@ int gvir_config_domain_graphics_spice_get_port(GVirConfigDomainGraphicsSpice *gr
>  {
>      g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN_GRAPHICS_SPICE(graphics), 0);
>  
> -    return gvir_config_object_get_attribute_uint64(GVIR_CONFIG_OBJECT(graphics),
> -                                                   NULL, "port", 0);
> +    return gvir_config_domain_graphics_remote_get_port(GVIR_CONFIG_DOMAIN_GRAPHICS_REMOTE(graphics));
>  }
>  
>  void gvir_config_domain_graphics_spice_set_port(GVirConfigDomainGraphicsSpice *graphics,
> @@ -186,8 +184,7 @@ const gchar *gvir_config_domain_graphics_spice_get_host(GVirConfigDomainGraphics
>  {
>      g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN_GRAPHICS_SPICE(graphics), NULL);
>  
> -    return gvir_config_object_get_attribute(GVIR_CONFIG_OBJECT(graphics),
> -                                            NULL, "listen");
> +    return gvir_config_domain_graphics_remote_get_host(GVIR_CONFIG_DOMAIN_GRAPHICS_REMOTE(graphics));
>  }
>  
>  void gvir_config_domain_graphics_spice_set_host(GVirConfigDomainGraphicsSpice *graphics,
> diff --git a/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.h b/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.h
> index 40d0e86..1fc708d 100644
> --- a/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.h
> +++ b/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.h
> @@ -43,7 +43,7 @@ typedef struct _GVirConfigDomainGraphicsSpiceClass GVirConfigDomainGraphicsSpice
>  
>  struct _GVirConfigDomainGraphicsSpice
>  {
> -    GVirConfigDomainGraphics parent;
> +    GVirConfigDomainGraphicsRemote parent;
>  
>      GVirConfigDomainGraphicsSpicePrivate *priv;
>  
> @@ -52,7 +52,7 @@ struct _GVirConfigDomainGraphicsSpice
>  
>  struct _GVirConfigDomainGraphicsSpiceClass
>  {
> -    GVirConfigDomainGraphicsClass parent_class;
> +    GVirConfigDomainGraphicsRemoteClass parent_class;
>  
>      gpointer padding[20];
>  };
> -- 
> 2.5.0
> 
> --
> libvir-list mailing list
> libvir-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/libvir-list

Attachment: signature.asc
Description: PGP signature

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