Commit d08779d4 by Serge Hallyn Committed by Stéphane Graber

load_config_locked: update unexp network

When we read a lxc.network.hwaddr line, if it contained any 'x's then those get quitely filled in at config_network_hwaddr. If that happens then we want to save the autogenerated hwaddr in the unexpanded config so that when we write it to disk, it is saved. This patch dumbly re-generates the network configuration in the unexp configuration every time we load a config file, just as we do after every clone. Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent 2eef2bda
...@@ -412,9 +412,11 @@ static bool load_config_locked(struct lxc_container *c, const char *fname) ...@@ -412,9 +412,11 @@ static bool load_config_locked(struct lxc_container *c, const char *fname)
c->lxc_conf = lxc_conf_init(); c->lxc_conf = lxc_conf_init();
if (!c->lxc_conf) if (!c->lxc_conf)
return false; return false;
if (!lxc_config_read(fname, c->lxc_conf, false)) if (lxc_config_read(fname, c->lxc_conf, false) != 0)
return true; return false;
return false; if (!clone_update_unexp_network(c->lxc_conf))
return false;
return true;
} }
static bool lxcapi_load_config(struct lxc_container *c, const char *alt_file) static bool lxcapi_load_config(struct lxc_container *c, const char *alt_file)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment