spice proxy support in govirt

Hi Christophe, This bug got closed not long ago: https://bugzilla.redhat.com/show_bug.cgi?id=1054948 and I got around to upgrading to oVirt 3.5 today. When I set the SpiceProxyDefault setting in oVirt: <display> ... <proxy>http://ovirt.iiordanov.com:8080</proxy> ... </display> -- The conscious mind has only one thread of execution.

Hello, My apologies for the partial mail sent out, I hit a strange key combination by mistake :). As I was saying, this bug got closed not long ago: https://bugzilla.redhat.com/show_bug.cgi?id=1054948 and I got around to upgrading to oVirt 3.5 today. When I set the SpiceProxyDefault setting in oVirt: engine-config -s SpiceProxyDefault="http://ovirt.iiordanov.com:8080" This results in a proxy property being exposed in the display property of a VM, thus: <display> ... <proxy>http://ovirt.iiordanov.com:8080</proxy> ... </display> I looked into the latest code of govirt, and I don't see support for SpiceProxy in there. Would you be so kind as to add this feature? Thanks! iordan On Sun, Dec 28, 2014 at 2:29 AM, i iordanov <iiordanov@gmail.com> wrote:
Hi Christophe,
This bug got closed not long ago:
https://bugzilla.redhat.com/show_bug.cgi?id=1054948
and I got around to upgrading to oVirt 3.5 today. When I set the SpiceProxyDefault setting in oVirt:
<display> ... <proxy>http://ovirt.iiordanov.com:8080</proxy> ... </display>
-- The conscious mind has only one thread of execution.
-- The conscious mind has only one thread of execution.

--bGR76rFJjkSxVeRa Content-Type: multipart/mixed; boundary="3O1VwFp74L81IIeR" Content-Disposition: inline --3O1VwFp74L81IIeR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey, On Sun, Dec 28, 2014 at 02:34:10AM -0600, i iordanov wrote:
Hello, =20 My apologies for the partial mail sent out, I hit a strange key combination by mistake :). As I was saying, this bug got closed not long ago:
Sorry for the late reply, was on holidays for a while, came back just now :)
I looked into the latest code of govirt, and I don't see support for SpiceProxy in there. Would you be so kind as to add this feature?
I quickly cooked/compile-tested the attached patch, if you have time to test it, let me know how it works, otherwise I'll get back to that later (need to get lot of email under control first ;) Christophe --3O1VwFp74L81IIeR Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="proxy.patch" Content-Transfer-Encoding: quoted-printable diff --git a/govirt/ovirt-vm-display.c b/govirt/ovirt-vm-display.c index a8a0942..0a8adc6 100644 --- a/govirt/ovirt-vm-display.c +++ b/govirt/ovirt-vm-display.c @@ -39,6 +39,7 @@ struct _OvirtVmDisplayPrivate { char *host_subject; gboolean smartcard; gboolean allow_override; + char *proxy_url; }; =20 G_DEFINE_TYPE(OvirtVmDisplay, ovirt_vm_display, G_TYPE_OBJECT); @@ -55,6 +56,7 @@ enum { PROP_HOST_SUBJECT, PROP_SMARTCARD, PROP_ALLOW_OVERRIDE, + PROP_PROXY_URL, }; =20 static void ovirt_vm_display_get_property(GObject *object, @@ -95,6 +97,9 @@ static void ovirt_vm_display_get_property(GObject *object, case PROP_ALLOW_OVERRIDE: g_value_set_boolean(value, display->priv->allow_override); break; + case PROP_PROXY_URL: + g_value_set_string(value, display->priv->proxy_url); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); } @@ -141,6 +146,9 @@ static void ovirt_vm_display_set_property(GObject *obje= ct, case PROP_ALLOW_OVERRIDE: display->priv->allow_override =3D g_value_get_boolean(value); break; + case PROP_PROXY_URL: + g_free(display->priv->proxy_url); + display->priv->proxy_url =3D g_value_dup_string(value); default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); } @@ -153,6 +161,7 @@ static void ovirt_vm_display_finalize(GObject *object) g_free(display->priv->address); g_free(display->priv->ticket); g_free(display->priv->host_subject); + g_free(display->priv->proxy_url); =20 G_OBJECT_CLASS(ovirt_vm_display_parent_class)->finalize(object); } @@ -252,6 +261,14 @@ static void ovirt_vm_display_class_init(OvirtVmDisplay= Class *klass) FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STR= INGS)); + g_object_class_install_property(object_class, + PROP_PROXY_URL, + g_param_spec_string("proxy-url", + "Proxy URL", + "URL of the proxy = to use to access the VM", + NULL, + G_PARAM_READWRITE | + G_PARAM_STATIC_STR= INGS)); } =20 static void ovirt_vm_display_init(G_GNUC_UNUSED OvirtVmDisplay *display) diff --git a/govirt/ovirt-vm-xml.c b/govirt/ovirt-vm-xml.c index 7790887..22d50af 100644 --- a/govirt/ovirt-vm-xml.c +++ b/govirt/ovirt-vm-xml.c @@ -44,6 +44,7 @@ static gboolean vm_set_display_from_xml(OvirtVm *vm, const char *certificate_key =3D g_intern_string("certificate"); const char *smartcard_key =3D g_intern_string("smartcard_enabled"); const char *allow_override_key =3D g_intern_string("allow_override"); + const char *proxy_key =3D g_intern_string("proxy"); =20 if (root =3D=3D NULL) { return FALSE; @@ -120,6 +121,11 @@ static gboolean vm_set_display_from_xml(OvirtVm *vm, } } =20 + node =3D g_hash_table_lookup(root->children, proxy_key); + if (node !=3D NULL) { + g_object_set(G_OBJECT(display), "proxy-url", node->content, NULL); + } + /* FIXME: this overrides the ticket/expiry which may * already be set */ --3O1VwFp74L81IIeR-- --bGR76rFJjkSxVeRa Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCAAGBQJUt7rlAAoJEKnYwhQprGyC6TYP/iBtd6mUIczKBuAfzwdt7zHQ QoD9mVoBIGL8PunS1MjnBvnKOHdgJHl3/uwfHbp7LpnyQhwFnS2BXMB8RulOI6LK mLa3s9TcO1t3fJ/Eudn1SaxSbZZxKROClec1HqdOyW07h9hV9uJC3XhiLS2qojFD miAWHD/JZrWDS/Ae2UHL6yIIjB4JtX4Btev22ofhRZY4L2bg2euJ3MzA85zju5Fb B3niRmp8GgihYIpNtD2huG+N49x3M/YTnG+psLZdGW8j7NUvSL8ienlDf3vpgi+g D64HUxNMlKVbMXLuj/Umr15PptQe9pAJqr6iVr4sSX5BI214GIjWo6ao3TiA+hHv zAaSEyvwZxab46ikoxwPoNbyzKurteJGwRcsk1EwUvZaGpAIL245qLtpiNDQvWfJ 5nQ0K0VCMislf7HjJ7B+5iN9C8KowZD+RyUeWTQwitvH04+ZYg0lgQ/JVmvhuH6j 7iP2SGGt398iHEF6Rg8DZPXh+h8jbEMV8ds4kRNTvpcmXJ4btm0v+caq9SNqpL1U YUHq3PBompzItLmGGFvNjR+ZICImPoRMu+hSvA6T845KV8G36/zC9+2ex5m+ZK4+ KkvVuK3FvXNcZOEV2YaQ4h/d/TVs0xFyhEKWeVS5h5DxX8EtwGKIeyWOSUlTAug3 lik1xY1mvH7l3i3OWtyB =8TzL -----END PGP SIGNATURE----- --bGR76rFJjkSxVeRa--

Hi Christophe, I am quite busy during the week, but I'll try to find time during the weekend. Thanks! iordan On Thu, Jan 15, 2015 at 8:04 AM, Christophe Fergeau <cfergeau@redhat.com> wrote:
Hey,
On Sun, Dec 28, 2014 at 02:34:10AM -0600, i iordanov wrote:
Hello,
My apologies for the partial mail sent out, I hit a strange key combination by mistake :). As I was saying, this bug got closed not long ago:
Sorry for the late reply, was on holidays for a while, came back just now :)
I looked into the latest code of govirt, and I don't see support for SpiceProxy in there. Would you be so kind as to add this feature?
I quickly cooked/compile-tested the attached patch, if you have time to test it, let me know how it works, otherwise I'll get back to that later (need to get lot of email under control first ;)
Christophe
-- The conscious mind has only one thread of execution.

--hQiwHBbRI9kgIhsi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 15, 2015 at 02:04:37PM +0100, Christophe Fergeau wrote:
I quickly cooked/compile-tested the attached patch, if you have time to test it, let me know how it works, otherwise I'll get back to that later (need to get lot of email under control first ;) =20 Christophe
diff --git a/govirt/ovirt-vm-display.c b/govirt/ovirt-vm-display.c index a8a0942..0a8adc6 100644 --- a/govirt/ovirt-vm-display.c +++ b/govirt/ovirt-vm-display.c @@ -141,6 +146,9 @@ static void ovirt_vm_display_set_property(GObject *ob= ject, case PROP_ALLOW_OVERRIDE: display->priv->allow_override =3D g_value_get_boolean(value); break; + case PROP_PROXY_URL: + g_free(display->priv->proxy_url); + display->priv->proxy_url =3D g_value_dup_string(value);
Missing break; here Apart from this, this is working fine, I've pushed it upstream: https://git.gnome.org/browse/libgovirt/commit/?id=3De2f4e6ae0975b24d4d4cb52= 1ff1a2948e91af0e3 Christophe --hQiwHBbRI9kgIhsi Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCAAGBQJUwR3SAAoJEKnYwhQprGyCVzIP/iV6YYItCqnmI0ObN3joZ4zu vFubyTsMu9o/uQxkqiN2XdGPpX5sqcrhp/HuxO5fDaLC+d7gTg/ylx24Q6Jw6Lde L9JbgqquaopFJj18Re2ifwNNt+4vHNDMhAvjNM1qoW7s4PbRQ6fnGnS8HxFQcLmd j6VRJrzkXq8QfyRS2zsvGlsR1eTMxHPailJ4ZDPUO6Ct6lKozOHyqytaAew5Eo2f A4UE8C0mGCyYlXx+b9iu1YqN7BQH4AxAV1Vi9u6VSQFXZaPFk5ka4eC1/NKBmaK3 0lbGJR09ADSDYcTPZXHrAk6Mv7zUYTFVZSHheQsCijJt9uFF4hRNUm7iJeOcieeg PF5ZPw6anrRt7JhG4cWKwLqSzP20CmuzhvuI+LIA5/SW+/EAvWJtpcGdw4gIDVA6 BekQCQX2bgQahbcv8JDHZahRKpPzpmL8M1CZdry7XM7hfFj2uOhAJPjj09lQe8hb /pzb57puwxAzKNTvKxczcAayCfDOPjmHsnmLgWh/EKe/bzi6XbW4oTa2oBgoCd2N XO0TsZLynEwTVj1MGfAXhD47TD+zVNKNyJsbx6g9Woqt/ou6hRgzpNuu4IyjdsKy QoBFFGX0Juv8NsegZsZ+3DPP4JnDYB013OocNat0q123UygTayOF0kBPg6z4GLGK oCPrkUQ5ZFq4yiVhZYu9 =Ln5o -----END PGP SIGNATURE----- --hQiwHBbRI9kgIhsi--
participants (2)
-
Christophe Fergeau
-
i iordanov