[gconfig v2 2/2] config: Add vnc listen setter

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

 



Learn to set the address that vnc is listening on.
---
 libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.c | 18 ++++++++++++++++++
 libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.h |  3 +++
 libvirt-gconfig/libvirt-gconfig.sym                   |  1 +
 3 files changed, 22 insertions(+)

diff --git a/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.c b/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.c
index fc26bb9..4187a8e 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.c
@@ -129,3 +129,21 @@ void gvir_config_domain_graphics_vnc_set_password(GVirConfigDomainGraphicsVnc *g
                                      "passwd", password,
                                      NULL);
 }
+
+void gvir_config_domain_graphics_vnc_set_listen_address(GVirConfigDomainGraphicsVnc *graphics,
+                                                    const char *address)
+{
+    g_return_if_fail(GVIR_CONFIG_IS_DOMAIN_GRAPHICS_VNC(graphics));
+
+    gvir_config_object_set_attribute(GVIR_CONFIG_OBJECT(graphics), "listen", address, NULL);
+
+    gvir_config_object_add_child_with_attribute(GVIR_CONFIG_OBJECT(graphics),
+                                                    "listen",
+                                                    "address",
+                                                    address);
+
+    gvir_config_object_add_child_with_attribute(GVIR_CONFIG_OBJECT(graphics),
+                                                    "listen",
+                                                    "type",
+                                                    "address");
+}
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.h b/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.h
index fe78621..e848cd7 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.h
+++ b/libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.h
@@ -76,6 +76,9 @@ void gvir_config_domain_graphics_vnc_set_port(GVirConfigDomainGraphicsVnc *graph
 void gvir_config_domain_graphics_vnc_set_password(GVirConfigDomainGraphicsVnc *graphics,
                                                   const char *password);
 
+void gvir_config_domain_graphics_vnc_set_listen_address(GVirConfigDomainGraphicsVnc *graphics,
+                                                    const char *address);
+
 G_END_DECLS
 
 #endif /* __LIBVIRT_GCONFIG_DOMAIN_GRAPHICS_VNC_H__ */
diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
index 86768ae..58b78b4 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -737,6 +737,7 @@ LIBVIRT_GCONFIG_0.2.4 {
 	gvir_config_domain_graphics_spice_set_gl;
 	gvir_config_domain_video_set_accel3d;
 	gvir_config_domain_graphics_spice_set_listen_address;
+	gvir_config_domain_graphics_vnc_set_listen_address;
 } LIBVIRT_GCONFIG_0.2.2;
 
 # .... define new API here using predicted next version number ....
-- 
2.5.5

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