ctxt->node = node;
- if (def->type != VIR_DOMAIN_GRAPHICS_TYPE_VNC &&
- def->type != VIR_DOMAIN_GRAPHICS_TYPE_RDP &&
- def->type != VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
- ret = 0;
- goto error;
- }
-
/* parse the <listen> subelements for graphics types that support it */
nListens = virXPathNodeSet("./listen", ctxt, &listenNodes);
if (nListens < 0)
static int
virDomainGraphicsDefParseXMLVNC(virDomainGraphicsDefPtr def,
xmlNodePtr node,
+ xmlXPathContextPtr ctxt,
unsigned int flags)
{
char *port = virXMLPropString(node, "port");
char *autoport = virXMLPropString(node, "autoport");
int ret = -1;
+ if (virDomainGraphicsListensParseXML(def, node, ctxt, flags) < 0)
+ goto error;
+
if (port) {
if (virStrToLong_i(port, NULL, 10, &def->data.vnc.port) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
static int
virDomainGraphicsDefParseXMLRDP(virDomainGraphicsDefPtr def,
xmlNodePtr node,
+ xmlXPathContextPtr ctxt,
unsigned int flags)
{
char *port = virXMLPropString(node, "port");
char *multiUser = virXMLPropString(node, "multiUser");
int ret = -1;
+ if (virDomainGraphicsListensParseXML(def, node, ctxt, flags) < 0)
+ goto error;
+
if (port) {
if (virStrToLong_i(port, NULL, 10, &def->data.rdp.port) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
static int
virDomainGraphicsDefParseXMLSpice(virDomainGraphicsDefPtr def,
xmlNodePtr node,
+ xmlXPathContextPtr ctxt,
unsigned int flags)
{
xmlNodePtr cur;
int defaultModeVal;
int ret = -1;
+ if (virDomainGraphicsListensParseXML(def, node, ctxt, flags) < 0)
+ goto error;
+
if (port) {
if (virStrToLong_i(port, NULL, 10, &def->data.spice.port) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
goto error;
}
- if (virDomainGraphicsListensParseXML(def, node, ctxt, flags) < 0)
- goto error;
-
switch ((virDomainGraphicsType)def->type) {
case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
- if (virDomainGraphicsDefParseXMLVNC(def, node, flags) < 0)
+ if (virDomainGraphicsDefParseXMLVNC(def, node, ctxt, flags) < 0)
goto error;
break;
case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
goto error;
break;
case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
- if (virDomainGraphicsDefParseXMLRDP(def, node, flags) < 0)
+ if (virDomainGraphicsDefParseXMLRDP(def, node, ctxt, flags) < 0)
goto error;
break;
case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
goto error;
break;
case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
- if (virDomainGraphicsDefParseXMLSpice(def, node, flags) < 0)
+ if (virDomainGraphicsDefParseXMLSpice(def, node, ctxt, flags) < 0)
goto error;
break;
case VIR_DOMAIN_GRAPHICS_TYPE_LAST: