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

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

 



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@xxxxxxxxx>
---
 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


[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