From: Ján Tomko Date: Mon, 11 Apr 2016 12:43:43 +0000 (+0200) Subject: conf: use the iterator directly when parsing video devices X-Git-Tag: v1.3.4-rc1~284 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca70db398e7386daa7311719b14e4fcce895deb6;p=thirdparty%2Flibvirt.git conf: use the iterator directly when parsing video devices We start with both i and def->nvideos at 0 and increment both after every successful iteration. Use i directly, instead of passing the def->nvideos value through j. --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 31577ae370..690287d879 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -16421,10 +16421,9 @@ virDomainDefParseXML(xmlDocPtr xml, goto error; for (i = 0; i < n; i++) { j = def->nvideos; - virDomainVideoDefPtr video = virDomainVideoDefParseXML(nodes[j], - def, - flags); - if (!video) + virDomainVideoDefPtr video; + + if (!(video = virDomainVideoDefParseXML(nodes[i], def, flags))) goto error; if (video->primary) {