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

Anton Protopopov aspsk2 at gmail.com
Wed Oct 1 14:08:55 UTC 2008


>
> If openvz kernel requries specification of a NIC name for inside the
> container, then this is an implemntation detail that the libvirt
> OpenVZ driver will have to deal with. It can auto-assign them to be
> eth0, eth1, etc. This is not exposed in the libvirt XML though, since
> it is not relevant to the host admin, only apps inside the guest.



>
> > * absolutely ignore the <target dev=".."> in openvz XML description
>
> As I said before this needs to reflect the name of the interface on
> the host side. It can be ignored when creating a guest, since for the
> majority of uses cases it can be safely auto-generated. It must be
> filled in when dumping XML for a guest, so the host admin knows which
> NIC in the host corresponds to the guest.
>

Here is the patch, that implements the following behaviour

* interface name inside container is automatically generated and equals
ethN,
   where N is the number of that interface within current domain
* mac address of that interface inside container is generated automatically
by
   function openvzGenerateMac
* if <target dev=""> is specified, use it; otherwise, use the default openvz
name,
   i.e., vethN.M for interface ethM in container with veid N
* if <mac address='...'> specified, use it; otherwise, vzctl will generate
it automatically
* <target dev> and <mac address> are (re)stored (from)to $veid.conf

Anton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20081001/f1227d43/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libvirt_openvz_ifaces_names_and_macs.patch
Type: application/octet-stream
Size: 6154 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20081001/f1227d43/attachment-0001.obj>


More information about the libvir-list mailing list