提交 7d0ff943 编写于 作者: P Pavel Hrdina

conf: switch from while to for loop for chardev parsing

This removes one level of indentation.
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
上级 e90ba254
......@@ -10926,8 +10926,10 @@ virDomainChrSourceDefParseXML(virDomainChrSourceDefPtr def,
char *haveTLS = NULL;
char *tlsFromConfig = NULL;
while (cur != NULL) {
if (cur->type == XML_ELEMENT_NODE) {
for (; cur; cur = cur->next) {
if (cur->type != XML_ELEMENT_NODE)
continue;
if (virXMLNodeNameEqual(cur, "source")) {
if (!mode)
mode = virXMLPropString(cur, "mode");
......@@ -11019,8 +11021,6 @@ virDomainChrSourceDefParseXML(virDomainChrSourceDefPtr def,
protocol = virXMLPropString(cur, "type");
}
}
cur = cur->next;
}
switch ((virDomainChrType) def->type) {
case VIR_DOMAIN_CHR_TYPE_NULL:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册