[libvirt] [RFC][PATCH] LXC allow a container to have ethN named interfaces

Ryota Ozaki ozaki.ryota at gmail.com
Wed Nov 4 12:46:01 UTC 2009

On Wed, Nov 4, 2009 at 6:02 AM, Daniel P. Berrange <berrange at redhat.com> wrote:
> On Tue, Nov 03, 2009 at 12:23:26AM +0900, Ryota Ozaki wrote:
>> Note that this patch is not mature yet and still proof-
>> of-concept prototype, although it actually works.
>> Current implementation of lxc driver creates vethN named
>> interface(s) in the host and passes as it is to a container.
>> The reason why it doesn't use ethN is due to the limitation
>> that one namespace cannot have multiple iterfaces that have
>> an identical name so that we give up creating ethN named
>> interface in the host for the container.
>> However, we should be able to allow the container to have
>> ethN by changing the name after clone(CLONE_NEWNET) in
>> controller.
>> To this end, this patch extends --veth argument of
>> controller to be able to have two names; one is the name
>> of a created veth, and the other is a new name. The format
>> is:
>>   --veth veth1,eth0 --veth veth3,eth1 ...
> Do we need to pass the names around on command line args ? Could
> we simply make libvirt_lxc auto-assign the names starting from
> eth0  instead of passing the names from libvirtd

I'm worrying two things; Is it ok that libvirt_lxc has such a decision? and
it seems a bit inflexible, is it acceptable?

Nevertheless, your suggestion makes code simple and sounds good idea
if the above things are not big deal. So I will rewrite my patch anyway.

Thank you for your review,

> THe patch is a good idea though regardless - having them named eth0 is
> much more familiar for users
> Daniel
> --
> |: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
> |: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
> |: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
> |: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

More information about the libvir-list mailing list