mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-05 12:35:20 +00:00
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:
parent
6d8b6d2847
commit
ca70db398e
@ -16421,10 +16421,9 @@ virDomainDefParseXML(xmlDocPtr xml,
|
|||||||
goto error;
|
goto error;
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
j = def->nvideos;
|
j = def->nvideos;
|
||||||
virDomainVideoDefPtr video = virDomainVideoDefParseXML(nodes[j],
|
virDomainVideoDefPtr video;
|
||||||
def,
|
|
||||||
flags);
|
if (!(video = virDomainVideoDefParseXML(nodes[i], def, flags)))
|
||||||
if (!video)
|
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (video->primary) {
|
if (video->primary) {
|
||||||
|
Loading…
Reference in New Issue
Block a user