- 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: Christian Brauner <christianvanbrauner@gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
goto out;
// update utsname
- if (!set_config_item_locked(c2, "lxc.utsname", newname)) {
- ERROR("Error setting new hostname");
- goto out;
+ if (!(flags & LXC_CLONE_KEEPNAME)) {
+ if (!set_config_item_locked(c2, "lxc.utsname", newname)) {
+ ERROR("Error setting new hostname");
+ goto out;
+ }
}
// copy hooks