[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] FreeBSD portability question, --network question



On Wed, Jun 15, 2011 at 12:37:00PM -0700, Jason Helfman wrote:
> Hey Everyone,
> 
> I've ported libvirt to FreeBSD, however it has the networking disabled for
> the build, however I was curious what would need to be changed for this to
> work.
> 
> Currently, we do have virtualbox-ose in the FreeBSD portstree, and I am
> curious if the networking would need to be reworked to support libvirt with
> networking in FreeBSD in the same manner in which virtualbox creates
> interfaces and uses the networking stack?
> 
> Basically, I am seeking to learn what is missing, and how to either find
> resources to get this implemented, or implement it myself. The latter of
> implementing it myself is unlikely, as I really don't have very much
> source control experience at a networking stack layer.

There are two aspects to networking in libvirt

The virtual network driver (in src/network/bridge_driver.c) uses
the Linux kernel's native 'bridge' functionality to provide an
isolated, or routed, or NATed network connection to guests. There
is a bridge device on the host created, and guest TAP devices are
added to it. There is no physical ethernet device added to the
bridge, and iptables is used to control whether the host OS routes
traffic to/from the bridge & physical LAN.

I don't know what  BSD has as an equivalent to Linux bridge/brctl
functionality, so can't suggest alternatives, but basically you'd
need to figure out how to do nat/routed/isolated guest configs
and write a new version of bridge_driver.c for BSD.

The host interface driver (in src/inteface/netcf_driver.c) uses
the netcf library to manage configuration of host network interfaces
todo things like bonding, vlans and bridging. Since, even with the
Linux world, every distro has a different way to configure network
interfaces, the core job is to port netcf to your OS. Basically on
Fedora, netcf reads&writes files /etc/sysconfig/network-scripts/ifcfg-XXX
and can call ifup/ifdown to take interfaces online/offline. So you'd
need to create a netcf backend that understands BSD's networking
configuration files and calls appropriate tools to bring intefaces
online/offline.

Both these jobs are pretty much independant, so can easily be
done in parallel.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]