[Libvirt-cim] [PATCH 02/20] Add others and unknown_device clean up

John Ferlan jferlan at redhat.com
Fri Nov 15 00:23:51 UTC 2013


From: Xu Wang <cngesaint at gmail.com>

Signed-off-by: Xu Wang <gesaint at linux.vnet.ibm.com>
---
 libxkutil/device_parsing.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/libxkutil/device_parsing.c b/libxkutil/device_parsing.c
index 56e39c7..6cdcfa9 100644
--- a/libxkutil/device_parsing.c
+++ b/libxkutil/device_parsing.c
@@ -79,6 +79,28 @@ static void cleanup_device_address(struct device_address *addr)
         addr->ct = 0;
 }
 
+static void cleanup_node_of_others(struct others *others)
+{
+        if (others == NULL)
+                return;
+
+        free(others->name);
+        free(others->parent_name);
+        free(others->value);
+        free(others);
+}
+
+static void cleanup_others(struct others *others)
+{
+        struct others *head = others;
+
+        while (others) {
+                head = others->next;
+                cleanup_node_of_others(others);
+                others = head;
+        }
+}
+
 static void cleanup_disk_device(struct disk_device *dev)
 {
         if (dev == NULL)
-- 
1.8.3.1




More information about the Libvirt-cim mailing list