提交 4bfe396e 编写于 作者: D Daniel P. Berrange

Blank out the 'listenAddr' parameter if empty string

Some bogus apps are generating a VNC/SPICE/RFB listen attribute
with no content. This then causes a failure with the graphics
migration cookie parsing. Blank out the 'listenAddr' parameter
after parsing domain XML if it is the empty string, so the host
default takes over

* src/qemu/qemu_migration.c: Blank out listenAddr parameter
  if empty
上级 8fcbc0c6
......@@ -3904,6 +3904,10 @@ virDomainGraphicsDefParseXML(xmlNodePtr node, int flags) {
def->data.vnc.socket = virXMLPropString(node, "socket");
def->data.vnc.keymap = virXMLPropString(node, "keymap");
if (def->data.vnc.listenAddr &&
!def->data.vnc.listenAddr[0])
VIR_FREE(def->data.vnc.listenAddr);
if (virDomainGraphicsAuthDefParseXML(node, &def->data.vnc.auth) < 0)
goto error;
} else if (def->type == VIR_DOMAIN_GRAPHICS_TYPE_SDL) {
......@@ -3968,6 +3972,10 @@ virDomainGraphicsDefParseXML(xmlNodePtr node, int flags) {
}
def->data.rdp.listenAddr = virXMLPropString(node, "listen");
if (def->data.rdp.listenAddr &&
!def->data.rdp.listenAddr[0])
VIR_FREE(def->data.rdp.listenAddr);
} else if (def->type == VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP) {
char *fullscreen = virXMLPropString(node, "fullscreen");
......@@ -4031,6 +4039,11 @@ virDomainGraphicsDefParseXML(xmlNodePtr node, int flags) {
def->data.spice.listenAddr = virXMLPropString(node, "listen");
def->data.spice.keymap = virXMLPropString(node, "keymap");
if (def->data.spice.listenAddr &&
!def->data.spice.listenAddr[0])
VIR_FREE(def->data.spice.listenAddr);
if (virDomainGraphicsAuthDefParseXML(node, &def->data.spice.auth) < 0)
goto error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册