[libvirt] [PATCH] openvz: swap <source bridge=...> with <target dev=...>

Anton Protopopov aspsk2 at gmail.com
Wed Oct 1 06:33:49 UTC 2008


2008/9/30 Daniel P. Berrange <berrange at redhat.com>

> On Tue, Sep 30, 2008 at 05:57:20PM +0400, Anton Protopopov wrote:
> > >
> > > Possibly, though its not terribly consistent so far.
> > >
> > > Xen  - vifNNN.MMM   (NNN dom ID, MMM = nic number)
> > > QEMU - vnetNNN      (NNN = global host nic number)
> > > LXC  - vethNNN      (MMM = global host nic number)
> >
> >
> > And how these drivers choose NNN? Do QEMU driver and LXC driver use the
> same
> > NNN?
>
> Start from vnet0 and look for the first available name.
>
> > >
> > > We can't change the format Xen uses, but it could be desirable to make
> > > LXC, QEMU and OpenVZ all use  vnetNNN scheme by default for auto
> assigned
> > > nics names on the host side.
> >
> >
> > Now openvz driver chooses not interface name in host, but interface name
> in
> > container.
>
> The interface name inside the container is not something that is expressed
> in the libvirt XML. That is left upto the guest OS to decide, and not
> something libvirt needs to care about.


In OpenVZ case you _must_ to decide what name the
interface will have inside the container. The command line for ading an
interface in OpenVZ looks like
  # vzctl set $veid --ifname_add ifname[mac, host_ifname, host_mac]
The only mandatory field is the name of _container interface_

The possible solution is the following:

* absolutely ignore the <target dev=".."> in openvz XML description
* Set (ifname, host_ifname) of the interface to (eth${N}, veth${ID}.${N}),
   where ID is the container id and N is the interface number within that
container.

It is simplifies saving the bridge name and adding the interface to the
bridge too,
for example, by adding the following line to the $veid.conf:
#BRIDGE$N: <name of bridge for interface # $N >


>
> We only care about configuration from the host side.
>

>
> 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/<http://search.cpan.org/%7Edanberr/>:|
> |: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505
> :|
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20081001/ae1ced80/attachment-0001.htm>


More information about the libvir-list mailing list