<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">If openvz kernel requries specification of a NIC name for inside the<br>

container, then this is an implemntation detail that the libvirt<br>
OpenVZ driver will have to deal with. It can auto-assign them to be<br>
eth0, eth1, etc. This is not exposed in the libvirt XML though, since<br>
it is not relevant to the host admin, only apps inside the guest.</blockquote><div> 
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d"><br>
> * absolutely ignore the <target dev=".."> in openvz XML description<br>
<br>
</div>As I said before this needs to reflect the name of the interface on<br>
the host side. It can be ignored when creating a guest, since for the<br>
majority of uses cases it can be safely auto-generated. It must be<br>
filled in when dumping XML for a guest, so the host admin knows which<br>
NIC in the host corresponds to the guest.<br>
<div><div></div><div class="Wj3C7c"></div></div></blockquote><div><br>Here is the patch, that implements the following behaviour<br><br>* interface name inside container is automatically generated and equals ethN,<br>   where N is the number of that interface within current domain<br>
* mac address of that interface inside container is generated automatically by<br>   function openvzGenerateMac<br>* if <target dev=""> is specified, use it; otherwise, use the default openvz name,<br>   i.e., vethN.M for interface ethM in container with veid N<br>
* if <mac address='...'> specified, use it; otherwise, vzctl will generate it automatically<br>* <target dev> and <mac address> are (re)stored (from)to $veid.conf<br></div></div><br>Anton<br></div>