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

[libvirt] [libvirt-glib 1/4] config: Implement gvir_config_domain_graphics_spice_set_listen



---
 libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.c | 10 ++++++++++
 libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.h |  3 +++
 libvirt-gconfig/libvirt-gconfig.sym                     |  2 ++
 libvirt-gconfig/tests/test-domain-create.c              |  1 +
 4 files changed, 16 insertions(+)

diff --git a/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.c b/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.c
index e60a778..3aef0aa 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.c
@@ -94,6 +94,16 @@ void gvir_config_domain_graphics_spice_set_password(GVirConfigDomainGraphicsSpic
                                      NULL);
 }
 
+void gvir_config_domain_graphics_spice_set_listen(GVirConfigDomainGraphicsSpice *graphics,
+                                                  const char *listen_ip)
+{
+    g_return_if_fail(GVIR_CONFIG_IS_DOMAIN_GRAPHICS_SPICE(graphics));
+
+    gvir_config_object_set_attribute(GVIR_CONFIG_OBJECT(graphics),
+                                     "listen", listen_ip,
+                                     NULL);
+}
+
 void gvir_config_domain_graphics_spice_set_port(GVirConfigDomainGraphicsSpice *graphics,
                                                 int port)
 {
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.h b/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.h
index d198813..bcaf04e 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.h
+++ b/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.h
@@ -68,6 +68,9 @@ void gvir_config_domain_graphics_spice_set_autoport(GVirConfigDomainGraphicsSpic
 void gvir_config_domain_graphics_spice_set_password(GVirConfigDomainGraphicsSpice *graphics,
                                                     const char *password);
 
+void gvir_config_domain_graphics_spice_set_listen(GVirConfigDomainGraphicsSpice *graphics,
+                                                  const char *listen_ip);
+
 void gvir_config_domain_graphics_spice_set_port(GVirConfigDomainGraphicsSpice *graphics,
                                                 int port);
 
diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
index f83eabb..0f41d78 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -464,6 +464,8 @@ LIBVIRT_GCONFIG_0.1.3 {
   global:
 	gvir_config_domain_get_current_memory;
 	gvir_config_domain_set_current_memory;
+
+	gvir_config_domain_graphics_spice_set_listen;
 } LIBVIRT_GCONFIG_0.1.0;
 
 # .... define new API here using predicted next version number ....
diff --git a/libvirt-gconfig/tests/test-domain-create.c b/libvirt-gconfig/tests/test-domain-create.c
index c3e627b..903281d 100644
--- a/libvirt-gconfig/tests/test-domain-create.c
+++ b/libvirt-gconfig/tests/test-domain-create.c
@@ -287,6 +287,7 @@ int main(int argc, char **argv)
 
     graphics = gvir_config_domain_graphics_spice_new();
     gvir_config_domain_graphics_spice_set_port(graphics, 1234);
+    gvir_config_domain_graphics_spice_set_listen(graphics, "127.0.0.1");
     devices = g_list_append(devices, GVIR_CONFIG_DOMAIN_DEVICE(graphics));
 
     /* video node */
-- 
1.7.11.4


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