]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: support abstracted interface info in network XML
authorLaine Stump <laine@laine.org>
Wed, 20 Jul 2011 03:01:09 +0000 (23:01 -0400)
committerLaine Stump <laine@laine.org>
Thu, 21 Jul 2011 18:46:53 +0000 (14:46 -0400)
commit40fd7073befbd6e8ed2b6935898079bb2ff874dd
tree9fa11051a8b082b55829e23467fd275d040c1234
parent07f4136993c3cce619ff92f4687171a335f6bf51
conf: support abstracted interface info in network XML

The network XML is updated in the following ways:

1) The <forward> element can now contain a list of forward interfaces:

     <forward .... >
       <interface dev='eth10'/>
       <interface dev='eth11'/>
       <interface dev='eth12'/>
       <interface dev='eth13'/>
     </forward>

   The first of these takes the place of the dev attribute that is
   normally in <forward> - when defining a network you can specify
   either one, and on output both will be present. If you specify
   both on input, they must match.

2) In addition to forward modes of 'nat' and 'route', these new modes
   are supported:

     private, passthrough, vepa - when this network is referenced by a
     domain's interface, it will have the same effect as if the
     interface had been defined as type='direct', e.g.:

        <interface type='direct'>
          <source mode='${mode}' dev='${dev}>
          ...
        </interface>

     where ${mode} is one of the three new modes, and ${dev} is an interface
     selected from the list given in <forward>.

     bridge - if a <forward> dev (or multiple devs) is defined, and
     forward mode is 'bridge' this is just like the modes 'private',
     'passthrough', and 'vepa' above. If there is no forward dev
     specified but a bridge name is given (e.g. "<bridge
     name='br0'/>"), then guest interfaces using this network will use
     libvirt's "host bridge" mode, equivalent to this:

       <interface type='bridge'>
          <source bridge='${bridge-name}'/>
          ...
       </interface>

3) A network can have multiple <portgroup> elements, which may be
   selected by the guest interface definition (by adding
   "portgroup='${name}'" in the <source> element along with the
   network name). Currently a portgroup can only contain a
   virtportprofile, but the intent is that other configuration items
   may be put there int the future (e.g. bandwidth config). When
   building a guest's interface, if the <interface> XML itself has no
   virtportprofile, and if the requested network has a portgroup with
   a name matching the name given in the <interface> (or if one of the
   network's portgroups is marked with the "default='yes'" attribute),
   the virtportprofile from that portgroup will be used by the
   interface.

4) A network can have a virtportprofile defined at the top level,
   which will be used by a guest interface when connecting in one of
   the 'direct' modes if the guest interface XML itself hasn't
   specified any virtportprofile, and if there are also no matching
   portgroups on the network.
18 files changed:
docs/schemas/network.rng
src/conf/network_conf.c
src/conf/network_conf.h
src/libvirt_private.syms
src/network/bridge_driver.c
tests/networkxml2xmlin/8021Qbh-net.xml [new file with mode: 0644]
tests/networkxml2xmlin/direct-net.xml [new file with mode: 0644]
tests/networkxml2xmlin/host-bridge-net.xml [new file with mode: 0644]
tests/networkxml2xmlin/vepa-net.xml [new file with mode: 0644]
tests/networkxml2xmlout/8021Qbh-net.xml [new file with mode: 0644]
tests/networkxml2xmlout/direct-net.xml [new file with mode: 0644]
tests/networkxml2xmlout/host-bridge-net.xml [new file with mode: 0644]
tests/networkxml2xmlout/nat-network-dns-hosts.xml
tests/networkxml2xmlout/nat-network-dns-txt-record.xml
tests/networkxml2xmlout/nat-network.xml
tests/networkxml2xmlout/routed-network.xml
tests/networkxml2xmlout/vepa-net.xml [new file with mode: 0644]
tests/networkxml2xmltest.c