Commit 8e8d33d0 by Christian Brauner Committed by Stéphane Graber

Make LXC_CLONE_KEEPNAME work

- Passing the LXC_CLONE_KEEPNAME flag to do_lxcapi_clone() was not respected and let to unexpected behaviour for e.g. lxc-clone. We wrap clear_unexp_config_line() and set_config_item_line() in an appropriate if-condition. Signed-off-by: 's avatarChristian Brauner <christianvanbrauner@gmail.com> Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
parent 8f52e47b
...@@ -2693,9 +2693,11 @@ static struct lxc_container *lxcapi_clone(struct lxc_container *c, const char *n ...@@ -2693,9 +2693,11 @@ static struct lxc_container *lxcapi_clone(struct lxc_container *c, const char *n
goto out; goto out;
// update utsname // update utsname
if (!set_config_item_locked(c2, "lxc.utsname", newname)) { if (!(flags & LXC_CLONE_KEEPNAME)) {
ERROR("Error setting new hostname"); if (!set_config_item_locked(c2, "lxc.utsname", newname)) {
goto out; ERROR("Error setting new hostname");
goto out;
}
} }
// copy hooks // copy hooks
......
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