[libvirt] [PATCH 5/5] qemu: keep websocketGenerated on libvirtd restarts

Nikolay Shirokovskiy posted 5 patches 7 years, 7 months ago
[libvirt] [PATCH 5/5] qemu: keep websocketGenerated on libvirtd restarts
Posted by Nikolay Shirokovskiy 7 years, 7 months ago
Otherwise after libvirtd restart we come back to issues fixed by
introducing this flag in [1].

[1] 61a0026a : qemu: Fix xml dump of autogenerated websocket

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
---
 src/conf/domain_conf.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index f4e59f6..e27a125 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -13574,6 +13574,7 @@ virDomainGraphicsDefParseXMLVNC(virDomainGraphicsDefPtr def,
 {
     char *port = virXMLPropString(node, "port");
     char *websocket = virXMLPropString(node, "websocket");
+    char *websocketGenerated = virXMLPropString(node, "websocketGenerated");
     char *sharePolicy = virXMLPropString(node, "sharePolicy");
     char *autoport = virXMLPropString(node, "autoport");
     int ret = -1;
@@ -13618,6 +13619,9 @@ virDomainGraphicsDefParseXMLVNC(virDomainGraphicsDefPtr def,
         }
     }
 
+    if (websocketGenerated && STREQ(websocketGenerated, "yes"))
+        def->data.vnc.websocketGenerated = true;
+
     if (sharePolicy) {
         int policy =
            virDomainGraphicsVNCSharePolicyTypeFromString(sharePolicy);
@@ -13643,6 +13647,7 @@ virDomainGraphicsDefParseXMLVNC(virDomainGraphicsDefPtr def,
     VIR_FREE(port);
     VIR_FREE(autoport);
     VIR_FREE(websocket);
+    VIR_FREE(websocketGenerated);
     VIR_FREE(sharePolicy);
     return ret;
 }
@@ -26245,6 +26250,10 @@ virDomainGraphicsDefFormat(virBufferPtr buf,
             else if (def->data.vnc.websocket)
                 virBufferAsprintf(buf, " websocket='%d'", def->data.vnc.websocket);
 
+            if (flags & VIR_DOMAIN_DEF_FORMAT_STATUS)
+                virBufferAsprintf(buf, " websocketGenerated='%s'",
+                                  def->data.vnc.websocketGenerated ? "yes" : "no");
+
             virDomainGraphicsListenDefFormatAddr(buf, glisten, flags);
             break;
         case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NONE:
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 5/5] qemu: keep websocketGenerated on libvirtd restarts
Posted by John Ferlan 7 years, 6 months ago

On 07/04/2018 07:03 AM, Nikolay Shirokovskiy wrote:
> Otherwise after libvirtd restart we come back to issues fixed by
> introducing this flag in [1].
> 
> [1] 61a0026a : qemu: Fix xml dump of autogenerated websocket
> 
> Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
> ---
>  src/conf/domain_conf.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 

Reviewed-by: John Ferlan <jferlan@redhat.com>

John

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list