diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b445469cfc..f260c42883 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -10729,11 +10729,18 @@ virDomainGraphicsListensParseXML(virDomainGraphicsDefPtr def, xmlNodePtr save = ctxt->node; virDomainGraphicsListenDefPtr address = NULL; char *listenAddr = NULL; + char *socketPath = NULL; int nListens; int ret = -1; ctxt->node = node; + if (def->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC && + (socketPath = virXMLPropString(node, "socket"))) { + ret = 0; + goto error; + } + /* parse the subelements for graphics types that support it */ nListens = virXPathNodeSet("./listen", ctxt, &listenNodes); if (nListens < 0) @@ -10786,6 +10793,7 @@ virDomainGraphicsListensParseXML(virDomainGraphicsDefPtr def, error: VIR_FREE(listenNodes); VIR_FREE(listenAddr); + VIR_FREE(socketPath); ctxt->node = save; return ret; } diff --git a/tests/genericxml2xmloutdata/generic-graphics-vnc-socket-listen.xml b/tests/genericxml2xmloutdata/generic-graphics-vnc-socket-listen.xml index a3b82fe693..d8742c6e9f 100644 --- a/tests/genericxml2xmloutdata/generic-graphics-vnc-socket-listen.xml +++ b/tests/genericxml2xmloutdata/generic-graphics-vnc-socket-listen.xml @@ -19,9 +19,7 @@ - - - +