<div dir="ltr">2008/10/1 Anton Protopopov <span dir="ltr"><<a href="mailto:aspsk2@gmail.com">aspsk2@gmail.com</a>></span><br><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;">
<div dir="ltr"><div class="gmail_quote"><div class="Ih2E3d"><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><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></div></div></blockquote></div><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</div></blockquote>
<div><br>Actually, I have some doubts about that patch: the functions openvzGenerateMac and<br>openvzGenerateVethName are taken from vzctl sources and slightly changed then. The problem<br>is that libvirt uses LGPL, while vzctl uses GPL. So you can't apply that patch, right? Even if it is<br>
good :)<br><br> </div></div><br></div>