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

[libvirt] [libvirt-glib/libvirt-gconfig 02/17] gconfig: Implement gvir_config_domain_graphics_spice_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-spice.c | 8 ++++++++
 libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.h | 1 +
 libvirt-gconfig/libvirt-gconfig.sym                     | 1 +
 3 files changed, 10 insertions(+)

diff --git a/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.c b/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.c
index 079ea27..3d44572 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.c
@@ -74,6 +74,14 @@ gvir_config_domain_graphics_spice_new_from_xml(const gchar *xml,
     return GVIR_CONFIG_DOMAIN_GRAPHICS_SPICE(object);
 }
 
+gboolean gvir_config_domain_graphics_spice_get_autoport(GVirConfigDomainGraphicsSpice *graphics)
+{
+    g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN_GRAPHICS_SPICE(graphics), FALSE);
+
+    return gvir_config_object_get_attribute_boolean(GVIR_CONFIG_OBJECT(graphics),
+                                                    NULL, "autoport", FALSE);
+}
+
 void gvir_config_domain_graphics_spice_set_autoport(GVirConfigDomainGraphicsSpice *graphics,
                                                     gboolean autoport)
 {
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.h b/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.h
index 25c132e..8c3b586 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.h
+++ b/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.h
@@ -72,6 +72,7 @@ GVirConfigDomainGraphicsSpice *gvir_config_domain_graphics_spice_new(void);
 GVirConfigDomainGraphicsSpice *gvir_config_domain_graphics_spice_new_from_xml(const gchar *xml,
                                                                               GError **error);
 
+gboolean gvir_config_domain_graphics_spice_get_autoport(GVirConfigDomainGraphicsSpice *graphics);
 void gvir_config_domain_graphics_spice_set_autoport(GVirConfigDomainGraphicsSpice *graphics,
                                                     gboolean autoport);
 
diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
index a907aed..a9c45e6 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -734,6 +734,7 @@ global:
 } LIBVIRT_GCONFIG_0.2.1;
 
 LIBVIRT_GCONFIG_0.2.4 {
+	gvir_config_domain_graphics_spice_get_autoport;
 	gvir_config_domain_graphics_spice_set_gl;
 	gvir_config_domain_graphics_vnc_get_autoport;
 	gvir_config_domain_video_set_accel3d;
-- 
2.5.0


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