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

Emele, Joshua M Joshua.M.Emele at boeing.com
Thu Jul 3 01:26:43 UTC 2008


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 at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20080702/0d06422b/attachment-0001.htm>


More information about the libvir-list mailing list