[lxc-devel] [PATCH] introduce lxcapi_rename for renaming containers

S.Çağlar Onur caglar at 10ur.org
Wed Dec 18 18:38:25 UTC 2013


Hey Serge,

On Tue, Dec 17, 2013 at 4:25 PM, Serge Hallyn <serge.hallyn at ubuntu.com> wrote:
> Quoting S.Çağlar Onur (caglar at 10ur.org):
>> On Mon, Dec 16, 2013 at 2:58 PM, Serge Hallyn <serge.hallyn at ubuntu.com> wrote:
>> > Quoting Stéphane Graber (stgraber at ubuntu.com):
>> >> On Mon, Dec 16, 2013 at 02:37:11PM -0500, S.Çağlar Onur wrote:
>> >> > Hi Serge,
>> >> >
>> >> > On Mon, Dec 16, 2013 at 9:47 AM, Serge Hallyn <serge.hallyn at ubuntu.com> wrote:
>> >> > > Quoting S.Çağlar Onur (caglar at 10ur.org):
>> >> > >> lxcapi_rename implemented as a convenience function as lately
>> >> > >> I find myself in a need to rename a container due to a
>> >> > >> typo in its name. I could have started over but didn't want
>> >> > >> to spend more time (to installing extra packages and changing
>> >> > >> their configuration) on it.
>> >> > >>
>> >> > >> c->clone() followed by c->destroy() did the trick for me and I
>> >> > >> though it could be helpful to the other people, so here it is.
>> >> > >>
>> >> > >> Signed-off-by: S.Çağlar Onur <caglar at 10ur.org>
>> >> > >
>> >> > > Looks ok, but should you be specifying LXC_CLONE_COPYHOOKS |
>> >> > > LXC_CLONE_KEEPMACADDR  as clone flags?
>> >> >
>> >> > I thought I should to be keeping the container intact as much as I
>> >> > can, assuming something might be using those values (like
>> >> > redhat/centos/fedora ifcfg-* files where you could specify HWADDR)
>> >>
>> >> I'm not sure about LXC_CLONE_COPYHOOKS but LXC_CLONE_KEEPMACADDR should
>> >> actually go towards your goal of having the copy be as close to the
>> >> original as possible (without it, the mac address would be changed).
>> >
>> > Yeah.  Çağlar, lemme know if you agree.
>>
>> Sure, you can drop LXC_CLONE_COPYHOOKS or alternatively I can send a
>> new patch tomorrow (I'll be offline rest of the day)
>
> Gah, I'm sorry.  Firstly I missed that you were already doing those.

Ah that's OK, I thought you are asking why I'm passing those :)

> Secondly, my delay has kept api_rename out of the beta1.  I've pushed
> it as is.  I'm still undecided about copyhooks, but the real answer
> there is that lxcapi_clone should copy any hooks which are under
> the container's directory unconditionally.

Yeah it makes sense, and in that case I guess we can remove
LXC_CLONE_COPYHOOKS completely (including lxc-clone).

> -serge
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel

Best,
-- 
S.Çağlar Onur <caglar at 10ur.org>


More information about the lxc-devel mailing list