mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-22 22:13:18 +00:00
graphics: don't parse listens if socket attribute is present
If socket attribute is present we start VNC that listens only on that unix socket. This makes the parser behave the same way as we actually use the socket attribute. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
72475ac3b3
commit
360cbf6f83
@ -10729,11 +10729,18 @@ virDomainGraphicsListensParseXML(virDomainGraphicsDefPtr def,
|
|||||||
xmlNodePtr save = ctxt->node;
|
xmlNodePtr save = ctxt->node;
|
||||||
virDomainGraphicsListenDefPtr address = NULL;
|
virDomainGraphicsListenDefPtr address = NULL;
|
||||||
char *listenAddr = NULL;
|
char *listenAddr = NULL;
|
||||||
|
char *socketPath = NULL;
|
||||||
int nListens;
|
int nListens;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
ctxt->node = node;
|
ctxt->node = node;
|
||||||
|
|
||||||
|
if (def->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC &&
|
||||||
|
(socketPath = virXMLPropString(node, "socket"))) {
|
||||||
|
ret = 0;
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
/* parse the <listen> subelements for graphics types that support it */
|
/* parse the <listen> subelements for graphics types that support it */
|
||||||
nListens = virXPathNodeSet("./listen", ctxt, &listenNodes);
|
nListens = virXPathNodeSet("./listen", ctxt, &listenNodes);
|
||||||
if (nListens < 0)
|
if (nListens < 0)
|
||||||
@ -10786,6 +10793,7 @@ virDomainGraphicsListensParseXML(virDomainGraphicsDefPtr def,
|
|||||||
error:
|
error:
|
||||||
VIR_FREE(listenNodes);
|
VIR_FREE(listenNodes);
|
||||||
VIR_FREE(listenAddr);
|
VIR_FREE(listenAddr);
|
||||||
|
VIR_FREE(socketPath);
|
||||||
ctxt->node = save;
|
ctxt->node = save;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -19,9 +19,7 @@
|
|||||||
<controller type='pci' index='0' model='pci-root'/>
|
<controller type='pci' index='0' model='pci-root'/>
|
||||||
<input type='mouse' bus='ps2'/>
|
<input type='mouse' bus='ps2'/>
|
||||||
<input type='keyboard' bus='ps2'/>
|
<input type='keyboard' bus='ps2'/>
|
||||||
<graphics type='vnc' socket='/tmp/QEMUGuest1-vnc.sock'>
|
<graphics type='vnc' socket='/tmp/QEMUGuest1-vnc.sock'/>
|
||||||
<listen type='address' address='127.0.0.1'/>
|
|
||||||
</graphics>
|
|
||||||
<video>
|
<video>
|
||||||
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
|
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
|
||||||
</video>
|
</video>
|
||||||
|
Loading…
Reference in New Issue
Block a user