This commit removes the full network entry setting: "lxc.network.X" to type only. Like "type", "name", "flags", etc. So, here no matter if the settings is "lxc.network.X" or "lxc.net.X.Y". Signed-off-by: Julio Faracco <jcfaracco@xxxxxxxxx> --- src/lxc/lxc_native.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c index c144f3c52e..ed50415a93 100644 --- a/src/lxc/lxc_native.c +++ b/src/lxc/lxc_native.c @@ -562,7 +562,7 @@ lxcNetworkParseDataIPs(const char *name, virConfValuePtr value, lxcNetworkParseD if (VIR_ALLOC(ip) < 0) return -1; - if (STREQ(name, "lxc.network.ipv6")) + if (STREQ(name, "ipv6")) family = AF_INET6; ipparts = virStringSplit(value->str, "/", 2); @@ -589,12 +589,11 @@ lxcNetworkParseDataIPs(const char *name, virConfValuePtr value, lxcNetworkParseD } static int -lxcNetworkWalkCallback(const char *name, virConfValuePtr value, void *data) +lxcNetworkParseDataSuffix(const char *name, virConfValuePtr value, lxcNetworkParseData *parseData) { - lxcNetworkParseData *parseData = data; int status; - if (STREQ(name, "lxc.network.type")) { + if (STREQ(name, "type")) { virDomainDefPtr def = parseData->def; size_t networks = parseData->networks; bool privnet = parseData->privnet; @@ -619,30 +618,31 @@ lxcNetworkWalkCallback(const char *name, virConfValuePtr value, void *data) /* Keep the new value */ parseData->type = value->str; } - else if (STREQ(name, "lxc.network.link")) + else if (STREQ(name, "link")) parseData->link = value->str; - else if (STREQ(name, "lxc.network.hwaddr")) + else if (STREQ(name, "hwaddr")) parseData->mac = value->str; - else if (STREQ(name, "lxc.network.flags")) + else if (STREQ(name, "flags")) parseData->flag = value->str; - else if (STREQ(name, "lxc.network.macvlan.mode")) + else if (STREQ(name, "macvlan.mode")) parseData->macvlanmode = value->str; - else if (STREQ(name, "lxc.network.vlan.id")) + else if (STREQ(name, "vlan.id")) parseData->vlanid = value->str; - else if (STREQ(name, "lxc.network.name")) + else if (STREQ(name, "name")) parseData->name = value->str; - else if (STREQ(name, "lxc.network.ipv4") || - STREQ(name, "lxc.network.ipv6")) { + else if (STREQ(name, "ipv4") || + STREQ(name, "ipv6")) { if (lxcNetworkParseDataIPs(name, value, parseData) < 0) return -1; - } else if (STREQ(name, "lxc.network.ipv4.gateway")) { + } else if (STREQ(name, "ipv4.gateway")) { parseData->gateway_ipv4 = value->str; - } else if (STREQ(name, "lxc.network.ipv6.gateway")) { + } else if (STREQ(name, "ipv6.gateway")) { parseData->gateway_ipv6 = value->str; - } else if (STRPREFIX(name, "lxc.network")) { + } else { VIR_WARN("Unhandled network property: %s = %s", name, value->str); + return -1; } return 0; -- 2.19.1