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

Daniel P. Berrange berrange at redhat.com
Tue Oct 14 15:06:57 UTC 2008

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:


So, if using openvz > 3.0.22, we should use this config param to record
the bridge and not invent our own.  

To make upgrades easy, we should also use this config syntax for version
of openvz <= 3.0.22, and simply document that they need to create a helper
script /usr/sbin/vznetaddbr  to make it work - they can even just grab
the helper script straight from newer openvz code. eg


|: 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/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

More information about the libvir-list mailing list