On Wed, Oct 08, 2008 at 01:02:44PM +0400, Anton Protopopov wrote:
> >
> > I do not undesrtand how it will simplify parsing: the iterator
> >> in parsing is an interface name, not bridge name. I attached a patch, so
> >> you will see how I do think about it :) (this patch includes all
> >> discussed changes)
> >>
> > My point of view is to use small count common methods to manipulate config
> > parameters. That is don't use array of differend methods for different types
> > of data. In current case we can transform format to be used common
> > functions.
> >
> > For example:
> > if we will use format
> > #BRIDGE-ifname=<>
> > we can drop openvzGetDefinedBridge and use one existing method
> > openvzReadConfigParam(veid, "#BRIDGE-ifname", value, sizeof(value));
This idea is not good - if someone starts the container outside of libvirt
using 'vzctl start 101', then the bridge config will not be activated.
The latest openvz code has explicit support in its configuration file
for setting the bridge device name, via a 'bridge=br0' attribute in
the NETIF= config setting. This can also be specified wehn invoking
the vzctl --netif_add command:
http://wiki.openvz.org/Virtual_Ethernet_device#Making_a_bridged_veth-device_persistent
So, if using openvz > 3.0.22, we should use this config param to record
the bridge and not invent our own.