[libvirt] <script path='...'/> ignored for interface types 'bridge' and 'network'

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

On Wed, Jul 02, 2008 at 06:26:43PM -0700, Emele, Joshua M wrote:
<interface type='bridge'> <source bridge='br0'/> <script path='/etc/libvirt/qemu/test1-networking'/> </interface>
Unfortunately this value is never used. I'm using:
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?
No, with network/bridge configs libvirt manages the device setup itself. With type=ethernet, device setup is handed off to the script specified. As such it it doesn't make any sense to use a script with network/bridge configs - its just not appicable Daniel -- |: 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 :|
participants (2)
-
Daniel P. Berrange
-
Emele, Joshua M