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

2016-07-25 Thread Visarion-Mingopol Alexandru-Viorel
I made this discussion a private one by mistake, so it's time for some
storytelling:

*Christophe Fergeau wrote:*
> For what it's worth, this patch series
https://www.redhat.com/archives/libvir-list/2016-March/msg00993.html
would have allowed not to have to implement this both for VNC and SPICE.
Not sure why it did not land so far, I'll have to read back the old
thread/check with Fidencio.

*>I wrote: *
 The host setter for SPICE from the patch list isn't working. If the
machine is running and the host is already set, you get this error:
 "Failed to set domain configuration: XML error: graphics listen attribute
127.0.0.1 must match address attribute of first listen element (found
0.0.0.0)"
You either have to set both addresses at the same time (what I did in my
patch) or maybe remove the  child, but I haven't
tried.

Actually, you can get the same error on VNC as well, so both setters from
the list aren't good. :(

*>Cristophe Fergeau wrote:*
Ah right, I remember these checks being added in libvirt. If you only
set a  node when there is no listen="xx" attribute, do you
know if a listen="xx" attribute is automatically added?

I expect that if the XML has both attributes, changing only the  node and not the listen="xx" attribute is going to cause the same
error?

*>I wrote:*
Yes and yes.
Changing only the  node when the listen attribute is present
causes the same error.

When setting the   node, if there is no listen attribute, the
listen attribute is automatically added.
Should I try to do this ?




Sorry for the mistake and let's continue finding a solution ! :)

On Mon, Jul 18, 2016 at 6:37 PM, Christophe Fergeau 
wrote:

> Hey,
>
> On Mon, Jul 18, 2016 at 04:36:40PM +0300, Visarion Alexandru wrote:
> > Learn to set the address that vnc is listening on.
>
> For what it's worth, this patch series
> https://www.redhat.com/archives/libvir-list/2016-March/msg00993.html
> would have allowed not to have to implement this both for VNC and SPICE.
> Not sure why it did not land so far, I'll have to read back the old
> thread/check with Fidencio.
>
> Christophe
>



-- 
Visarion-Mingopol Alexandru-Viorel
Telefon : 0729614060
Best Bucuresti
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

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

2016-07-18 Thread Christophe Fergeau
Hey,

On Mon, Jul 18, 2016 at 04:36:40PM +0300, Visarion Alexandru wrote:
> Learn to set the address that vnc is listening on.

For what it's worth, this patch series
https://www.redhat.com/archives/libvir-list/2016-March/msg00993.html
would have allowed not to have to implement this both for VNC and SPICE.
Not sure why it did not land so far, I'll have to read back the old
thread/check with Fidencio.

Christophe


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

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

2016-07-18 Thread Visarion Alexandru
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@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list