return clr_config_network_type(key, lxc_conf, data);
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.type\" without an index "
+ "(e.g.\"lxc.network.0.type\") is DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
return clr_config_network_flags(key, lxc_conf, data);
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.flags\" without an index "
+ "(e.g.\"lxc.network.0.flags\") is DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
return clr_config_network_link(key, lxc_conf, data);
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.link\" without an index "
+ "(e.g.\"lxc.network.0.link\") is DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
return clr_config_network_name(key, lxc_conf, data);
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.name\" without an index "
+ "(e.g.\"lxc.network.0.name\") is DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
return clr_config_network_veth_pair(key, lxc_conf, data);
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.veth.pair\" without an "
+ "index (e.g. \"lxc.network.0.veth.pair\") is DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
return clr_config_network_macvlan_mode(key, lxc_conf, data);
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.macvlan.mode\" without an "
+ "index (e.g. \"lxc.network.0.macvlan.mode\" is "
+ "DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
if (lxc_config_value_empty(value))
return clr_config_network_hwaddr(key, lxc_conf, data);
+ /* lxc.network.* without an index */
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.hwaddr\" without an index "
+ "(e.g. \"lxc.network.0.hwaddr\") is DEPRECATED.");
+ netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
+ } else {
+ netdev = data;
+ }
+ if (!netdev)
+ return -1;
+
new_value = strdup(value);
if (!new_value) {
SYSERROR("failed to strdup \"%s\"", value);
}
rand_complete_hwaddr(new_value);
- /* lxc.network.* without an index */
- if (!data)
- netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
- netdev = data;
- if (!netdev) {
- free(new_value);
- return -1;
- }
-
if (lxc_config_value_empty(new_value)) {
free(new_value);
netdev->hwaddr = NULL;
return clr_config_network_vlan_id(key, lxc_conf, data);
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.vlan.id\" without an index "
+ "(e.g. \"lxc.network.0.vlan.id\") is DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
return clr_config_network_mtu(key, lxc_conf, data);
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.mtu\" without an index "
+ "(e.g. \"lxc.network.0.mtu\") is DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
return clr_config_network_ipv4(key, lxc_conf, data);
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.ipv4\" without an index "
+ "(e.g. \"lxc.network.0.ipv4\") is DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
return clr_config_network_ipv4_gateway(key, lxc_conf, data);
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.ipv4.gateway\" without an "
+ "index (e.g. \"lxc.network.0.ipv4.gateway\" is "
+ "DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
return clr_config_network_ipv6(key, lxc_conf, data);
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.ipv6\" without an index "
+ "(e.g. \"lxc.network.0.ipv6\") is DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
return clr_config_network_ipv6_gateway(key, lxc_conf, data);
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.ipv6.gateway\" without an "
+ "index (e.g. \"lxc.network.0.ipv6.gateway\" is "
+ "DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
return clr_config_network_script_up(key, lxc_conf, data);
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.script.up\" without an "
+ "index (e.g. \"lxc.network.0.script.up\" is "
+ "DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
return clr_config_network_script_down(key, lxc_conf, data);
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.script.down\" without an "
+ "index (e.g. \"lxc.network.0.script.down\" is "
+ "DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
if (!copy)
return NULL;
+ /* lxc.network.<n> */
if (isdigit(*(key + 12))) {
int ret;
unsigned int tmpidx;
if (!config || idx < 0)
return -1;
- netdev = lxc_get_netdev_by_idx(lxc_conf, (unsigned int)idx);
+ netdev = lxc_find_netdev_by_idx(lxc_conf, (unsigned int)idx);
if (!netdev)
return -1;
struct lxc_netdev *netdev;
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.type\" without an index "
+ "(e.g. \"lxc.network.0.type\") is DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
struct lxc_netdev *netdev;
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.name\" without an index "
+ "(e.g. \"lxc.network.0.name\") is DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
struct lxc_netdev *netdev;
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.flags\" without an index "
+ "(e.g. \"lxc.network.0.flags\") is DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
struct lxc_netdev *netdev;
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.link\" without an index "
+ "(e.g. \"lxc.network.0.link\") is DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
struct lxc_netdev *netdev;
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.macvlan.mode\" without an "
+ "index (e.g. \"lxc.network.0.macvlan.mode\" is "
+ "DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
struct lxc_netdev *netdev;
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.veth.pair\" without an "
+ "index (e.g. \"lxc.network.0.veth.pair\" is "
+ "DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
struct lxc_netdev *netdev;
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.script.up\" without an "
+ "index (e.g. \"lxc.network.0.script.up\" is "
+ "DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
struct lxc_netdev *netdev;
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.script.down\" without an "
+ "index (e.g. \"lxc.network.0.script.down\" is "
+ "DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
struct lxc_netdev *netdev;
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.hwaddr\" without an index "
+ "(e.g. \"lxc.network.0.hwaddr\") is DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
struct lxc_netdev *netdev;
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.mtu\" without an index "
+ "(e.g. \"lxc.network.0.mtu\") is DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
struct lxc_netdev *netdev;
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.vlan.id\" without an index "
+ "(e.g. \"lxc.network.0.vlan.id\") is DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
struct lxc_netdev *netdev;
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.ipv4.gateway\" without an "
+ "index (e.g. \"lxc.network.0.ipv4.gateway\" is "
+ "DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
struct lxc_list *cur, *next;
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.ipv4\" without an index "
+ "(e.g. \"lxc.network.0.ipv4\") is DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
+ if (!netdev)
+ return -1;
lxc_list_for_each_safe(cur, &netdev->ipv4, next) {
lxc_list_del(cur);
struct lxc_netdev *netdev;
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.ipv6.gateway\" without an "
+ "index (e.g. \"lxc.network.0.ipv6.gateway\" is "
+ "DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
struct lxc_list *cur, *next;
/* lxc.network.* without an index */
- if (!data)
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.ipv6\" without an index "
+ "(e.g. \"lxc.network.0.ipv6\") is DEPRECATED.");
netdev = lxc_get_netdev_by_idx(lxc_conf, 0);
- else
+ } else {
netdev = data;
+ }
+ if (!netdev)
+ return -1;
lxc_list_for_each_safe(cur, &netdev->ipv6, next) {
lxc_list_del(cur);
memset(retv, 0, inlen);
/* lxc.network.* without an index */
- if (!data)
- netdev = lxc_find_netdev_by_idx(c, 0);
- else
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.type\" without an index "
+ "(e.g. \"lxc.network.0.type\") is DEPRECATED.");
+ netdev = lxc_get_netdev_by_idx(c, 0);
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
memset(retv, 0, inlen);
/* lxc.network.* without an index */
- if (!data)
- netdev = lxc_find_netdev_by_idx(c, 0);
- else
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.flags\" without an index "
+ "(e.g. \"lxc.network.0.flags\") is DEPRECATED.");
+ netdev = lxc_get_netdev_by_idx(c, 0);
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
memset(retv, 0, inlen);
/* lxc.network.* without an index */
- if (!data)
- netdev = lxc_find_netdev_by_idx(c, 0);
- else
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.link\" without an index "
+ "(e.g. \"lxc.network.0.link\") is DEPRECATED.");
+ netdev = lxc_get_netdev_by_idx(c, 0);
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
memset(retv, 0, inlen);
/* lxc.network.* without an index */
- if (!data)
- netdev = lxc_find_netdev_by_idx(c, 0);
- else
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.name\" without an index "
+ "(e.g. \"lxc.network.0.name\") is DEPRECATED.");
+ netdev = lxc_get_netdev_by_idx(c, 0);
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
memset(retv, 0, inlen);
/* lxc.network.* without an index */
- if (!data)
- netdev = lxc_find_netdev_by_idx(c, 0);
- else
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.macvlan.mode\" without an "
+ "index (e.g. \"lxc.network.0.macvlan.mode\" is "
+ "DEPRECATED.");
+ netdev = lxc_get_netdev_by_idx(c, 0);
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
memset(retv, 0, inlen);
/* lxc.network.* without an index */
- if (!data)
- netdev = lxc_find_netdev_by_idx(c, 0);
- else
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.veth.pair\" without an "
+ "index (e.g. \"lxc.network.0.veth.pair\" is "
+ "DEPRECATED.");
+ netdev = lxc_get_netdev_by_idx(c, 0);
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
memset(retv, 0, inlen);
/* lxc.network.* without an index */
- if (!data)
- netdev = lxc_find_netdev_by_idx(c, 0);
- else
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.script.up\" without an "
+ "index (e.g. \"lxc.network.0.script.up\" is "
+ "DEPRECATED.");
+ netdev = lxc_get_netdev_by_idx(c, 0);
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
memset(retv, 0, inlen);
/* lxc.network.* without an index */
- if (!data)
- netdev = lxc_find_netdev_by_idx(c, 0);
- else
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.script.down\" without an "
+ "index (e.g. \"lxc.network.0.script.down\" is "
+ "DEPRECATED.");
+ netdev = lxc_get_netdev_by_idx(c, 0);
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
memset(retv, 0, inlen);
/* lxc.network.* without an index */
- if (!data)
- netdev = lxc_find_netdev_by_idx(c, 0);
- else
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.hwaddr\" without an index "
+ "(e.g. \"lxc.network.0.hwaddr\") is DEPRECATED.");
+ netdev = lxc_get_netdev_by_idx(c, 0);
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
memset(retv, 0, inlen);
/* lxc.network.* without an index */
- if (!data)
- netdev = lxc_find_netdev_by_idx(c, 0);
- else
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.mtu\" without an index "
+ "(e.g. \"lxc.network.0.mtu\") is DEPRECATED.");
+ netdev = lxc_get_netdev_by_idx(c, 0);
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
memset(retv, 0, inlen);
/* lxc.network.* without an index */
- if (!data)
- netdev = lxc_find_netdev_by_idx(c, 0);
- else
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.vlan.id\" without an index "
+ "(e.g. \"lxc.network.0.vlan.id\") is DEPRECATED.");
+ netdev = lxc_get_netdev_by_idx(c, 0);
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
memset(retv, 0, inlen);
/* lxc.network.* without an index */
- if (!data)
- netdev = lxc_find_netdev_by_idx(c, 0);
- else
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.ipv4.gateway\" without an "
+ "index (e.g. \"lxc.network.0.ipv4.gateway\" is "
+ "DEPRECATED.");
+ netdev = lxc_get_netdev_by_idx(c, 0);
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
memset(retv, 0, inlen);
/* lxc.network.* without an index */
- if (!data)
- netdev = lxc_find_netdev_by_idx(c, 0);
- else
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.ipv4\" without an index "
+ "(e.g. \"lxc.network.0.ipv4\") is DEPRECATED.");
+ netdev = lxc_get_netdev_by_idx(c, 0);
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
memset(retv, 0, inlen);
/* lxc.network.* without an index */
- if (!data)
- netdev = lxc_find_netdev_by_idx(c, 0);
- else
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.ipv6.gateway\" without an "
+ "index (e.g. \"lxc.network.0.ipv6.gateway\" is "
+ "DEPRECATED.");
+ netdev = lxc_get_netdev_by_idx(c, 0);
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;
memset(retv, 0, inlen);
/* lxc.network.* without an index */
- if (!data)
- netdev = lxc_find_netdev_by_idx(c, 0);
- else
+ if (!data) {
+ WARN("WARNING: using \"lxc.network.ipv6\" without an index "
+ "(e.g. \"lxc.network.0.ipv6\") is DEPRECATED.");
+ netdev = lxc_get_netdev_by_idx(c, 0);
+ } else {
netdev = data;
+ }
if (!netdev)
return -1;