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

[libvirt] [libvirt-glib/libvirt-gconfig 13/17] gconfig: Adapt GVirConfigDomainGraphicsVnc to GVirConfigDomainGraphicsRemote



This patch adapts GVirConfigDomainGraphicsVnc to the new
GVirConfigDomainGraphicsRemote, inheriting from it and using its helper
functions for getting auport and port properties.

As GVirConfigDomainGraphicsVnc now inherits from
GVirConfigDomainGraphicsRemote, this patch also introduces an ABI
breakage.

Signed-off-by: Fabiano Fidêncio <fidencio redhat com>
---
 libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.c | 11 ++++-------
 libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.h |  4 ++--
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.c b/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.c
index 94068a8..4bd7b25 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.c
@@ -33,7 +33,7 @@ struct _GVirConfigDomainGraphicsVncPrivate
     gboolean unused;
 };
 
-G_DEFINE_TYPE(GVirConfigDomainGraphicsVnc, gvir_config_domain_graphics_vnc, GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS);
+G_DEFINE_TYPE(GVirConfigDomainGraphicsVnc, gvir_config_domain_graphics_vnc, GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_REMOTE);
 
 
 static void gvir_config_domain_graphics_vnc_class_init(GVirConfigDomainGraphicsVncClass *klass)
@@ -96,8 +96,7 @@ gboolean gvir_config_domain_graphics_vnc_get_autoport(GVirConfigDomainGraphicsVn
 {
     g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN_GRAPHICS_VNC(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_vnc_set_autoport(GVirConfigDomainGraphicsVnc *graphics,
@@ -114,8 +113,7 @@ int gvir_config_domain_graphics_vnc_get_port(GVirConfigDomainGraphicsVnc *graphi
 {
     g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN_GRAPHICS_VNC(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_vnc_set_port(GVirConfigDomainGraphicsVnc *graphics,
@@ -142,8 +140,7 @@ const gchar *gvir_config_domain_graphics_vnc_get_host(GVirConfigDomainGraphicsVn
 {
     g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN_GRAPHICS_VNC(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_vnc_set_host(GVirConfigDomainGraphicsVnc *graphics,
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.h b/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.h
index cad26ca..f3556ad 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.h
+++ b/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.h
@@ -42,7 +42,7 @@ typedef struct _GVirConfigDomainGraphicsVncClass GVirConfigDomainGraphicsVncClas
 
 struct _GVirConfigDomainGraphicsVnc
 {
-    GVirConfigDomainGraphics parent;
+    GVirConfigDomainGraphicsRemote parent;
 
     GVirConfigDomainGraphicsVncPrivate *priv;
 
@@ -51,7 +51,7 @@ struct _GVirConfigDomainGraphicsVnc
 
 struct _GVirConfigDomainGraphicsVncClass
 {
-    GVirConfigDomainGraphicsClass parent_class;
+    GVirConfigDomainGraphicsRemoteClass parent_class;
 
     gpointer padding[20];
 };
-- 
2.5.0


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