From: Ján Tomko Date: Thu, 26 Feb 2015 13:33:26 +0000 (+0100) Subject: Ignore listen attribute of for type network listens X-Git-Tag: v1.2.13~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c45e8bec887fba6a5b0f8cc5c2c9d310cfa3deb;p=thirdparty%2Flibvirt.git Ignore listen attribute of for type network listens Commit 6992994 started filling the listen attribute of the parent elements from type='network' listens. When this XML is passed to UpdateDevice, parsing fails: XML error: graphics listen attribute 10.20.30.40 must match address attribute of first listen element (found none) Ignore the address in the parent attribute when no type='address' listens are found, the same we ignore the address for the subelements when parsing inactive XML. --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d95dd3ebd5..9b7ae3f2ae 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9614,12 +9614,16 @@ virDomainGraphicsDefParseXML(xmlNodePtr node, break; } } - if (!matched) { + if (found && !matched) { virReportError(VIR_ERR_XML_ERROR, _("graphics listen attribute %s must match address " "attribute of first listen element (found %s)"), - listenAddr, found ? found : "none"); + listenAddr, found); goto error; + } else if (!found) { + /* quietly ignore listen address if none of the listens + * are of type address */ + VIR_FREE(listenAddr); } } }