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.
This commit is contained in:
Ján Tomko 2016-04-11 14:43:43 +02:00
parent 6d8b6d2847
commit ca70db398e

View File

@ -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) {