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

[libvirt] [libvirt-glib/libvirt-gconfig 01/17] gconfig: Implement gvir_config_domain_graphics_vnc_get_autoport()



For completeness and also because it's useful for libvirt-gconfig API's
consumers who are interested on reading the guest configuration, like
virt-viewer.

Signed-off-by: Fabiano Fidêncio <fidencio redhat com>
---
 libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.c | 8 ++++++++
 libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.h | 1 +
 libvirt-gconfig/libvirt-gconfig.sym                   | 1 +
 3 files changed, 10 insertions(+)

diff --git a/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.c b/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.c
index fc26bb9..96bbd74 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.c
@@ -92,6 +92,14 @@ void gvir_config_domain_graphics_vnc_set_socket(GVirConfigDomainGraphicsVnc *gra
                                      NULL);
 }
 
+gboolean gvir_config_domain_graphics_vnc_get_autoport(GVirConfigDomainGraphicsVnc *graphics)
+{
+    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);
+}
+
 void gvir_config_domain_graphics_vnc_set_autoport(GVirConfigDomainGraphicsVnc *graphics,
                                                   gboolean autoport)
 {
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.h b/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.h
index fe78621..1d7afec 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.h
+++ b/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.h
@@ -66,6 +66,7 @@ const char *gvir_config_domain_graphics_vnc_get_socket(GVirConfigDomainGraphicsV
 void gvir_config_domain_graphics_vnc_set_socket(GVirConfigDomainGraphicsVnc *graphics,
                                                 const char *socket);
 
+gboolean gvir_config_domain_graphics_vnc_get_autoport(GVirConfigDomainGraphicsVnc *graphics);
 void gvir_config_domain_graphics_vnc_set_autoport(GVirConfigDomainGraphicsVnc *graphics,
                                                   gboolean autoport);
 
diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
index f11f97a..a907aed 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -735,6 +735,7 @@ global:
 
 LIBVIRT_GCONFIG_0.2.4 {
 	gvir_config_domain_graphics_spice_set_gl;
+	gvir_config_domain_graphics_vnc_get_autoport;
 	gvir_config_domain_video_set_accel3d;
 } LIBVIRT_GCONFIG_0.2.2;
 
-- 
2.5.0


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