From: Laine Stump Date: Tue, 14 Aug 2012 15:03:38 +0000 (-0400) Subject: conf: log error when encountering multiple filterrefs in interface X-Git-Tag: v0.10.0-rc1~129 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f7a291c964a4656e06591543af1069b7538160c;p=thirdparty%2Flibvirt.git conf: log error when encountering multiple filterrefs in interface Each interface has a single pointer to a filterref object. That filterref can itself point to multiple other filterrefs, but at the toplevel there is only one. The parser had previously just silently overwritten earlier filterrefs when a new one was encountered, so the interface was left with whichever was the last filterref in the xml, ignoring all the others. This patch logs an error when it sees more than one filterref. --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e52119b973..62f5f5b08b 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4619,6 +4619,12 @@ virDomainNetDefParseXML(virCapsPtr caps, ioeventfd = virXMLPropString(cur, "ioeventfd"); event_idx = virXMLPropString(cur, "event_idx"); } else if (xmlStrEqual (cur->name, BAD_CAST "filterref")) { + if (filter) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("Invalid specification of multiple s " + "in a single ")); + goto error; + } filter = virXMLPropString(cur, "filter"); virNWFilterHashTableFree(filterparams); filterparams = virNWFilterParseParamAttributes(cur);