mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 09:53:10 +00:00
3f9274a524
The following config elements now support a <vlan> subelements: within a domain: <interface>, and the <actual> subelement of <interface> within a network: the toplevel, as well as any <portgroup> Each vlan element must have one or more <tag id='n'/> subelements. If there is more than one tag, it is assumed that vlan trunking is being requested. If trunking is required with only a single tag, the attribute "trunk='yes'" should be added to the toplevel <vlan> element. Some examples: <interface type='hostdev'/> <vlan> <tag id='42'/> </vlan> <mac address='52:54:00:12:34:56'/> ... </interface> <network> <name>vlan-net</name> <vlan trunk='yes'> <tag id='30'/> </vlan> <virtualport type='openvswitch'/> </network> <interface type='network'/> <source network='vlan-net'/> ... </interface> <network> <name>trunk-vlan</name> <vlan> <tag id='42'/> <tag id='43'/> </vlan> ... </network> <network> <name>multi</name> ... <portgroup name='production'/> <vlan> <tag id='42'/> </vlan> </portgroup> <portgroup name='test'/> <vlan> <tag id='666'/> </vlan> </portgroup> </network> <interface type='network'/> <source network='multi' portgroup='test'/> ... </interface> IMPORTANT NOTE: As of this patch there is no backend support for the vlan element for *any* network device type. When support is added in later patches, it will only be for those select network types that support setting up a vlan on the host side, without the guest's involvement. (For example, it will be possible to configure a vlan for a guest connected to an openvswitch bridge, but it won't be possible to do that for one that is connected to a standard Linux host bridge.)
208 lines
5.6 KiB
XML
208 lines
5.6 KiB
XML
<?xml version="1.0"?>
|
|
<!-- network-related definitions used in multiple grammars -->
|
|
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
|
|
|
<define name="virtualPortProfileID">
|
|
<data type="string">
|
|
<param name="maxLength">39</param>
|
|
</data>
|
|
</define>
|
|
|
|
<define name="virtualPortProfile">
|
|
<choice>
|
|
<group>
|
|
<element name="virtualport">
|
|
<attribute name="type">
|
|
<value>802.1Qbg</value>
|
|
</attribute>
|
|
<optional>
|
|
<element name="parameters">
|
|
<optional>
|
|
<attribute name="managerid">
|
|
<ref name="uint8range"/>
|
|
</attribute>
|
|
</optional>
|
|
<optional>
|
|
<attribute name="typeid">
|
|
<ref name="uint24range"/>
|
|
</attribute>
|
|
</optional>
|
|
<optional>
|
|
<attribute name="typeidversion">
|
|
<ref name="uint8range"/>
|
|
</attribute>
|
|
</optional>
|
|
<optional>
|
|
<attribute name="instanceid">
|
|
<ref name="UUID"/>
|
|
</attribute>
|
|
</optional>
|
|
</element>
|
|
</optional>
|
|
</element>
|
|
</group>
|
|
<group>
|
|
<element name="virtualport">
|
|
<attribute name="type">
|
|
<value>802.1Qbh</value>
|
|
</attribute>
|
|
<optional>
|
|
<element name="parameters">
|
|
<optional>
|
|
<attribute name="profileid">
|
|
<ref name="virtualPortProfileID"/>
|
|
</attribute>
|
|
</optional>
|
|
</element>
|
|
</optional>
|
|
</element>
|
|
</group>
|
|
<group>
|
|
<element name="virtualport">
|
|
<attribute name="type">
|
|
<value>openvswitch</value>
|
|
</attribute>
|
|
<optional>
|
|
<element name="parameters">
|
|
<optional>
|
|
<attribute name="profileid">
|
|
<ref name="virtualPortProfileID"/>
|
|
</attribute>
|
|
</optional>
|
|
<optional>
|
|
<attribute name="interfaceid">
|
|
<ref name="UUID"/>
|
|
</attribute>
|
|
</optional>
|
|
</element>
|
|
</optional>
|
|
</element>
|
|
</group>
|
|
<group>
|
|
<!-- use this when no type attribute is present -->
|
|
<element name="virtualport">
|
|
<optional>
|
|
<element name="parameters">
|
|
<optional>
|
|
<attribute name="managerid">
|
|
<ref name="uint8range"/>
|
|
</attribute>
|
|
</optional>
|
|
<optional>
|
|
<attribute name="typeid">
|
|
<ref name="uint24range"/>
|
|
</attribute>
|
|
</optional>
|
|
<optional>
|
|
<attribute name="typeidversion">
|
|
<ref name="uint8range"/>
|
|
</attribute>
|
|
</optional>
|
|
<optional>
|
|
<attribute name="instanceid">
|
|
<ref name="UUID"/>
|
|
</attribute>
|
|
</optional>
|
|
<optional>
|
|
<attribute name="profileid">
|
|
<ref name="virtualPortProfileID"/>
|
|
</attribute>
|
|
</optional>
|
|
<optional>
|
|
<attribute name="interfaceid">
|
|
<ref name="UUID"/>
|
|
</attribute>
|
|
</optional>
|
|
</element>
|
|
</optional>
|
|
</element>
|
|
</group>
|
|
</choice>
|
|
</define>
|
|
|
|
<define name="bandwidth">
|
|
<element name="bandwidth">
|
|
<interleave>
|
|
<optional>
|
|
<element name="inbound">
|
|
<ref name="bandwidth-attributes"/>
|
|
<empty/>
|
|
</element>
|
|
</optional>
|
|
<optional>
|
|
<element name="outbound">
|
|
<ref name="bandwidth-attributes"/>
|
|
<empty/>
|
|
</element>
|
|
</optional>
|
|
</interleave>
|
|
</element>
|
|
</define>
|
|
|
|
<define name="bandwidth-attributes">
|
|
<attribute name="average">
|
|
<ref name="speed"/>
|
|
</attribute>
|
|
<optional>
|
|
<attribute name="peak">
|
|
<ref name="speed"/>
|
|
</attribute>
|
|
</optional>
|
|
<optional>
|
|
<attribute name='burst'>
|
|
<ref name="BurstSize"/>
|
|
</attribute>
|
|
</optional>
|
|
</define>
|
|
|
|
<define name="speed">
|
|
<data type="unsignedInt">
|
|
<param name="pattern">[0-9]+</param>
|
|
<param name="minInclusive">1</param>
|
|
</data>
|
|
</define>
|
|
<define name="BurstSize">
|
|
<data type="unsignedInt">
|
|
<param name="pattern">[0-9]+</param>
|
|
<param name="minInclusive">1</param>
|
|
</data>
|
|
</define>
|
|
|
|
<define name='unsignedShort'>
|
|
<data type='integer'>
|
|
<param name="minInclusive">0</param>
|
|
<param name="maxInclusive">65535</param>
|
|
</data>
|
|
</define>
|
|
<define name='protocol'>
|
|
<data type='string'>
|
|
<param name='pattern'>(tcp)|(udp)</param>
|
|
</data>
|
|
</define>
|
|
<define name='addr-family'>
|
|
<data type='string'>
|
|
<param name="pattern">(ipv4)|(ipv6)</param>
|
|
</data>
|
|
</define>
|
|
|
|
<define name="vlan">
|
|
<element name="vlan">
|
|
<optional>
|
|
<attribute name="trunk">
|
|
<value>yes</value>
|
|
</attribute>
|
|
</optional>
|
|
<oneOrMore>
|
|
<element name="tag">
|
|
<attribute name="id">
|
|
<data type="unsignedInt">
|
|
<param name="maxInclusive">4095</param>
|
|
</data>
|
|
</attribute>
|
|
<empty/>
|
|
</element>
|
|
</oneOrMore>
|
|
</element>
|
|
</define>
|
|
</grammar>
|