Hello,
I'm new to libvirt, but I've looked around the internet for answers to
my question with little success. I'd like to have a configuration script
do host network integration when starting a virtual machine using virsh.
The documentation
(
http://libvirt.org/formatdomain.html#elementsNICSBridge) suggests that
the interface configuration can include a script tag that describes the
path to the configuration script. My domain configuration
(/etc/libvirt/qemu/test1.xml) includes:
<interface type='bridge'>
<source bridge='br0'/>
<script path='/etc/libvirt/qemu/test1-networking'/>
</interface>
Unfortunately this value is never used. I'm using:
[root@thoroughbred qemu]# rpm -qi libvirt
Name : libvirt Relocations: (not
relocatable)
Version : 0.4.3 Vendor: Fedora
Project
Release : 1.fc8 Build Date: Fri 13 Jun
2008 03:15:16 AM PDT
Looking at the source, the script value is used when 'ethernet' is
specified (libvirt-0.4.3/src/qemu_conf.c:2690):
case QEMUD_NET_ETHERNET:
{
char arg[PATH_MAX];
if (snprintf(arg, PATH_MAX-1,
"tap,ifname=%s,script=%s,vlan=%d",
net->dst.ethernet.ifname,
net->dst.ethernet.script,
vlan) >= (PATH_MAX-1))
goto error;
ADD_ARG_LIT(arg);
}
However, the script value is not used when 'bridge' or 'network' is
specified (libvirt-0.4.3/src/qemu_conf.c:2313):
snprintf(tapfdstr, sizeof(tapfdstr),
"tap,fd=%d,script=,vlan=%d,ifname=%s",
tapfd, vlan, ifname);
Is there a way to force libvirt to use the specified script with
interface type 'network' or 'bridge'? If not, are there plans in the
future to do so?
Cheers,
Joshua Emele