qemu: keep websocketGenerated on libvirtd restarts

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>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
Nikolay Shirokovskiy 2018-07-04 13:17:23 +03:00
parent 30f9a64cbd
commit d7bc6af648

View File

@ -13498,6 +13498,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;
@ -13542,6 +13543,9 @@ virDomainGraphicsDefParseXMLVNC(virDomainGraphicsDefPtr def,
}
}
if (websocketGenerated && STREQ(websocketGenerated, "yes"))
def->data.vnc.websocketGenerated = true;
if (sharePolicy) {
int policy =
virDomainGraphicsVNCSharePolicyTypeFromString(sharePolicy);
@ -13567,6 +13571,7 @@ virDomainGraphicsDefParseXMLVNC(virDomainGraphicsDefPtr def,
VIR_FREE(port);
VIR_FREE(autoport);
VIR_FREE(websocket);
VIR_FREE(websocketGenerated);
VIR_FREE(sharePolicy);
return ret;
}
@ -26399,6 +26404,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: