[libvirt] [PATCH 2/6] lxc: Create a new method called lxcNetworkParseDataEntry().

Julio Faracco jcfaracco at gmail.com
Mon Feb 18 19:09:06 UTC 2019


This new method is responsible to verify is the settings correspond to
network entry. Right now, it is only verifying "lxc.network.", but in
the future, it can be used to verify "lxc.net.X." too. Any other case
would be rejected.

On the other hand, the idea here is working only with types. If we know
that entry is part of network settings, after we just need to know which
type is. It keeps the hanlder simple.

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

diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c
index 5bbbbf132c..c144f3c52e 100644
--- a/src/lxc/lxc_native.c
+++ b/src/lxc/lxc_native.c
@@ -648,6 +648,14 @@ lxcNetworkWalkCallback(const char *name, virConfValuePtr value, void *data)
     return 0;
 }
 
+static int
+lxcNetworkParseDataEntry(const char *name, virConfValuePtr value, lxcNetworkParseData *parseData)
+{
+    const char *suffix = STRSKIP(name, "lxc.network.");
+
+    return lxcNetworkParseDataSuffix(suffix, value, parseData);
+}
+
 static int
 lxcConvertNetworkSettings(virDomainDefPtr def, virConfPtr properties)
 {
-- 
2.19.1




More information about the libvir-list mailing list