The method lxcNetworkWalkCallback() needs to be simple enough to handle
both possible network settings with indexes or the simple one. It is
better the decouple the whole algorithm to parse data to only parse
which entry type libvirt is handling.

Signed-off-by: Julio Faracco <jcfara...@gmail.com>
---
 src/lxc/lxc_native.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c
index ed50415a93..95e08c18f4 100644
--- a/src/lxc/lxc_native.c
+++ b/src/lxc/lxc_native.c
@@ -656,6 +656,19 @@ lxcNetworkParseDataEntry(const char *name, virConfValuePtr 
value, lxcNetworkPars
     return lxcNetworkParseDataSuffix(suffix, value, parseData);
 }
 
+static int
+lxcNetworkWalkCallback(const char *name,
+                       virConfValuePtr value,
+                       void *data)
+{
+    lxcNetworkParseData *parseData = data;
+
+    if (STRPREFIX(name, "lxc.network."))
+        return lxcNetworkParseDataEntry(name, value, parseData);
+
+    return 0;
+}
+
 static int
 lxcConvertNetworkSettings(virDomainDefPtr def, virConfPtr properties)
 {
-- 
2.19.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to