[libvirt PATCH 03/10] virNWFilterParseParamAttributes: Iterate over "element" children

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"xmlNextElementSibling()" skips attribute nodes, making the explicit
check for the type of `cur` redundant. This prepares for the removal
of this check in the next commit.

Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
---
 src/conf/nwfilter_params.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/conf/nwfilter_params.c b/src/conf/nwfilter_params.c
index c94e9679f8..3754cec55f 100644
--- a/src/conf/nwfilter_params.c
+++ b/src/conf/nwfilter_params.c
@@ -703,7 +703,7 @@ virNWFilterParseParamAttributes(xmlNodePtr cur)
 
     GHashTable *table = virHashNew(virNWFilterVarValueHashFree);
 
-    cur = cur->children;
+    cur = xmlFirstElementChild(cur);
 
     while (cur != NULL) {
         if (cur->type == XML_ELEMENT_NODE) {
@@ -739,7 +739,7 @@ virNWFilterParseParamAttributes(xmlNodePtr cur)
                 VIR_FREE(val);
             }
         }
-        cur = cur->next;
+        cur = xmlNextElementSibling(cur);
     }
     return table;
 
-- 
2.31.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux