@@ -6760,9 +6760,10 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
rawio = virXMLPropString(node, "rawio");
sgio = virXMLPropString(node, "sgio");
- cur = node->children;
- while (cur != NULL) {
- if (cur->type == XML_ELEMENT_NODE) {
+ for (cur = node->children; cur != NULL; cur = cur->next) {
+ if (cur->type != XML_ELEMENT_NODE)
+ continue;
+
if (!source && xmlStrEqual(cur->name, BAD_CAST "source")) {
sourceNode = cur;
@@ -7176,8 +7177,6 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
/* boot is parsed as part of virDomainDeviceInfoParseXML */
}
}
- cur = cur->next;
- }
/* Disk volume types will have authentication information handled in
* virStorageTranslateDiskSourcePool