[libvirt-glib PATCHv2 2/3] Add a few GVirConfigDomainGraphicsVnc getters

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

 



---
 libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.c | 16 ++++++++++++++++
 libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.h |  2 ++
 libvirt-gconfig/libvirt-gconfig.sym                   |  2 ++
 3 files changed, 20 insertions(+)

diff --git a/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.c b/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.c
index c9fc408..41ac2a0 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.c
@@ -76,6 +76,14 @@ gvir_config_domain_graphics_vnc_new_from_xml(const gchar *xml,
 }
 
 
+const char *gvir_config_domain_graphics_vnc_get_socket(GVirConfigDomainGraphicsVnc *graphics)
+{
+    g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN_GRAPHICS_VNC(graphics), NULL);
+
+    return gvir_config_object_get_attribute(GVIR_CONFIG_OBJECT(graphics),
+                                            NULL, "socket");
+}
+
 void gvir_config_domain_graphics_vnc_set_socket(GVirConfigDomainGraphicsVnc *graphics,
                                                 const char *socket)
 {
@@ -96,6 +104,14 @@ void gvir_config_domain_graphics_vnc_set_autoport(GVirConfigDomainGraphicsVnc *g
                                                NULL);
 }
 
+int gvir_config_domain_graphics_vnc_get_port(GVirConfigDomainGraphicsVnc *graphics)
+{
+    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);
+}
+
 void gvir_config_domain_graphics_vnc_set_port(GVirConfigDomainGraphicsVnc *graphics,
                                               int port)
 {
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.h b/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.h
index 0d3173c..09a53e1 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.h
+++ b/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.h
@@ -62,12 +62,14 @@ GVirConfigDomainGraphicsVnc *gvir_config_domain_graphics_vnc_new(void);
 GVirConfigDomainGraphicsVnc *gvir_config_domain_graphics_vnc_new_from_xml(const gchar *xml,
                                                                           GError **error);
 
+const char *gvir_config_domain_graphics_vnc_get_socket(GVirConfigDomainGraphicsVnc *graphics);
 void gvir_config_domain_graphics_vnc_set_socket(GVirConfigDomainGraphicsVnc *graphics,
                                                 const char *socket);
 
 void gvir_config_domain_graphics_vnc_set_autoport(GVirConfigDomainGraphicsVnc *graphics,
                                                   gboolean autoport);
 
+int gvir_config_domain_graphics_vnc_get_port(GVirConfigDomainGraphicsVnc *graphics);
 void gvir_config_domain_graphics_vnc_set_port(GVirConfigDomainGraphicsVnc *graphics,
                                               int port);
 
diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
index c60cc4e..17a8e11 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -465,6 +465,8 @@ LIBVIRT_GCONFIG_0.1.3 {
 	gvir_config_domain_get_current_memory;
 	gvir_config_domain_set_current_memory;
 
+	gvir_config_domain_graphics_vnc_get_port;
+	gvir_config_domain_graphics_vnc_get_socket;
 	gvir_config_domain_graphics_vnc_set_socket;
 } LIBVIRT_GCONFIG_0.1.0;
 
-- 
1.7.11.4

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