Re: [libvirt-glib/libvirt-gconfig 06/17] gconfig: Implement gvir_config_domain_graphics_spice_get_tls_port()

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

 



For patches up to this one:

Acked-by: Christophe Fergeau <cfergeau@xxxxxxxxxx>

You could have added a few more tests like this:

diff --git a/tests/test-gconfig.c b/tests/test-gconfig.c
index be55ef9..d78292c 100644
--- a/tests/test-gconfig.c
+++ b/tests/test-gconfig.c
@@ -466,6 +466,10 @@ static void test_domain_device_graphics(void)
     graphics = gvir_config_domain_graphics_spice_new();
     gvir_config_domain_graphics_spice_set_port(graphics, 1234);
     g_assert_cmpint(gvir_config_domain_graphics_spice_get_port(graphics), ==, 1234);
+    gvir_config_domain_graphics_spice_set_autoport (graphics, TRUE);
+    g_assert_true(gvir_config_domain_graphics_spice_get_autoport(graphics));
+    gvir_config_domain_graphics_spice_set_tls_port (graphics, 4321);
+    g_assert_cmpint(gvir_config_domain_graphics_spice_get_tls_port(graphics), ==, 4321);

     /* SPICE image compression configuration */
     gvir_config_domain_graphics_spice_set_image_compression
diff --git a/tests/xml/gconfig-domain-device-graphics.xml b/tests/xml/gconfig-domain-device-graphics.xml
index 5d90c5c..bbfd0ae 100644
--- a/tests/xml/gconfig-domain-device-graphics.xml
+++ b/tests/xml/gconfig-domain-device-graphics.xml
@@ -1,6 +1,6 @@
 <domain>
   <devices>
-    <graphics type="spice" port="1234">
+    <graphics type="spice" port="1234" autoport="yes" tlsPort="4321">
       <image compression="auto_lz"/>
     </graphics>
   </devices>

but they are very basic, so maybe not worth having too many of these :)

Christophe

On Tue, Mar 22, 2016 at 11:04:42AM +0100, Fabiano Fidêncio wrote:
> Signed-off-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx>
> ---
>  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 3d44572..b781537 100644
> --- a/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.c
> +++ b/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.c
> @@ -120,6 +120,14 @@ void gvir_config_domain_graphics_spice_set_port(GVirConfigDomainGraphicsSpice *g
>                                                 NULL);
>  }
>  
> +int gvir_config_domain_graphics_spice_get_tls_port(GVirConfigDomainGraphicsSpice *graphics)
> +{
> +    g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN_GRAPHICS_SPICE(graphics), 0);
> +
> +    return gvir_config_object_get_attribute_uint64(GVIR_CONFIG_OBJECT(graphics),
> +                                                   NULL, "tlsPort", 0);
> +}
> +
>  void gvir_config_domain_graphics_spice_set_tls_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 8c3b586..9703fdd 100644
> --- a/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.h
> +++ b/libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.h
> @@ -83,6 +83,7 @@ int gvir_config_domain_graphics_spice_get_port(GVirConfigDomainGraphicsSpice *gr
>  void gvir_config_domain_graphics_spice_set_port(GVirConfigDomainGraphicsSpice *graphics,
>                                                  int port);
>  
> +int gvir_config_domain_graphics_spice_get_tls_port(GVirConfigDomainGraphicsSpice *graphics);
>  void gvir_config_domain_graphics_spice_set_tls_port(GVirConfigDomainGraphicsSpice *graphics,
>                                                      int port);
>  
> diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
> index 3beb1ed..be9887c 100644
> --- a/libvirt-gconfig/libvirt-gconfig.sym
> +++ b/libvirt-gconfig/libvirt-gconfig.sym
> @@ -738,6 +738,7 @@ LIBVIRT_GCONFIG_0.2.4 {
>  	gvir_config_domain_graphics_sdl_get_display;
>  	gvir_config_domain_graphics_sdl_get_fullscreen;
>  	gvir_config_domain_graphics_spice_get_autoport;
> +	gvir_config_domain_graphics_spice_get_tls_port;
>  	gvir_config_domain_graphics_spice_set_gl;
>  	gvir_config_domain_graphics_vnc_get_autoport;
>  	gvir_config_domain_video_set_accel3d;
> -- 
> 2.5.0
> 
> --
> libvir-list mailing list
> libvir-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/libvir-list

Attachment: signature.asc
Description: PGP signature

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