2011-06-29 04:38:10 +00:00
|
|
|
<?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>
|
conf: support partially-specified <virtualport> in parser and formatter
Until now, all attributes in a <virtualport> parameter list that were
acceptable for a particular type, were also required. There were no
optional attributes.
One of the aims of supporting <virtualport> in libvirt's virtual
networks and portgroups is to allow specifying the group-wide
parameters in the network's virtualport, and merge that with the
interface's virtualport, which will have the instance-specific info
(i.e. the interfaceid or instanceid).
Additionally, the guest's interface XML shouldn't need to know what
type of network connection will be used prior to runtime - it could be
openvswitch, 802.1Qbh, 802.1Qbg, or none of the above - but should
still be able to specify instance-specific info just in case it turns
out to be applicable.
Finally, up to now, the parser for virtualport has always generated a
random instanceid/interfaceid when appropriate, making it impossible
to leave it blank (which is what's required for virtualports within a
network/portprofile definition).
This patch modifies the parser and formatter of the <virtualport>
element in the following ways:
* because most of the attributes in a virNetDevVPortProfile are fixed
size binary data with no reserved values, there is no way to embed a
"this value wasn't specified" sentinel into the existing data. To
solve this problem, the new *_specified fields in the
virNetDevVPortProfile object that were added in a previous patch of
this series are now set when the corresponding attribute is present
during the parse.
* allow parsing/formatting a <virtualport> that has no type set. In
this case, all fields are settable, but all are also optional.
* add a GENERATE_MISSING_DEFAULTS flag to the parser - if this flag is
set and an instanceid/interfaceid is expected but not provided, a
random one will be generated. This was previously the default
behavior, but is now done only for virtualports inside an
<interface> definition, not for those in <network> or <portgroup>.
* add a REQUIRE_ALL_ATTRIBUTES flag to the parser - if this flag is
set the parser will call the new
virNetDevVPortProfileCheckComplete() functions at the end of the
parser to check for any missing attributes (based on type), and
return failure if anything is missing. This used to be default
behavior. Now it is only used for the virtualport defined inside an
interface's <actual> element (by the time you've figured out the
contents of <actual>, you should have all the necessary data to fill
in the entire virtualport)
* add a REQUIRE_TYPE flag to the parser - if this flag is set, the
parser will return an error if the virtualport has no type
attribute. This also was previously the default behavior, but isn't
needed in the case of the virtualport for a type='network' interface
(i.e. the exact type isn't yet known), or the virtualport of a
portgroup (i.e. the portgroup just has modifiers for the network's
virtualport, which *does* require a type) - in those cases, the
check will be done at domain startup, once the final virtualport is
assembled (this is handled in the next patch).
2012-07-31 18:36:51 +00:00
|
|
|
<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>
|
2011-06-29 04:38:10 +00:00
|
|
|
</element>
|
|
|
|
</group>
|
|
|
|
<group>
|
|
|
|
<element name="virtualport">
|
|
|
|
<attribute name="type">
|
|
|
|
<value>802.1Qbh</value>
|
|
|
|
</attribute>
|
conf: support partially-specified <virtualport> in parser and formatter
Until now, all attributes in a <virtualport> parameter list that were
acceptable for a particular type, were also required. There were no
optional attributes.
One of the aims of supporting <virtualport> in libvirt's virtual
networks and portgroups is to allow specifying the group-wide
parameters in the network's virtualport, and merge that with the
interface's virtualport, which will have the instance-specific info
(i.e. the interfaceid or instanceid).
Additionally, the guest's interface XML shouldn't need to know what
type of network connection will be used prior to runtime - it could be
openvswitch, 802.1Qbh, 802.1Qbg, or none of the above - but should
still be able to specify instance-specific info just in case it turns
out to be applicable.
Finally, up to now, the parser for virtualport has always generated a
random instanceid/interfaceid when appropriate, making it impossible
to leave it blank (which is what's required for virtualports within a
network/portprofile definition).
This patch modifies the parser and formatter of the <virtualport>
element in the following ways:
* because most of the attributes in a virNetDevVPortProfile are fixed
size binary data with no reserved values, there is no way to embed a
"this value wasn't specified" sentinel into the existing data. To
solve this problem, the new *_specified fields in the
virNetDevVPortProfile object that were added in a previous patch of
this series are now set when the corresponding attribute is present
during the parse.
* allow parsing/formatting a <virtualport> that has no type set. In
this case, all fields are settable, but all are also optional.
* add a GENERATE_MISSING_DEFAULTS flag to the parser - if this flag is
set and an instanceid/interfaceid is expected but not provided, a
random one will be generated. This was previously the default
behavior, but is now done only for virtualports inside an
<interface> definition, not for those in <network> or <portgroup>.
* add a REQUIRE_ALL_ATTRIBUTES flag to the parser - if this flag is
set the parser will call the new
virNetDevVPortProfileCheckComplete() functions at the end of the
parser to check for any missing attributes (based on type), and
return failure if anything is missing. This used to be default
behavior. Now it is only used for the virtualport defined inside an
interface's <actual> element (by the time you've figured out the
contents of <actual>, you should have all the necessary data to fill
in the entire virtualport)
* add a REQUIRE_TYPE flag to the parser - if this flag is set, the
parser will return an error if the virtualport has no type
attribute. This also was previously the default behavior, but isn't
needed in the case of the virtualport for a type='network' interface
(i.e. the exact type isn't yet known), or the virtualport of a
portgroup (i.e. the portgroup just has modifiers for the network's
virtualport, which *does* require a type) - in those cases, the
check will be done at domain startup, once the final virtualport is
assembled (this is handled in the next patch).
2012-07-31 18:36:51 +00:00
|
|
|
<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>
|
2015-02-23 20:54:55 +00:00
|
|
|
<group>
|
|
|
|
<element name="virtualport">
|
|
|
|
<attribute name="type">
|
|
|
|
<value>midonet</value>
|
|
|
|
</attribute>
|
|
|
|
<element name="parameters">
|
|
|
|
<attribute name="interfaceid">
|
|
|
|
<ref name="UUID"/>
|
|
|
|
</attribute>
|
|
|
|
</element>
|
|
|
|
</element>
|
|
|
|
</group>
|
conf: support partially-specified <virtualport> in parser and formatter
Until now, all attributes in a <virtualport> parameter list that were
acceptable for a particular type, were also required. There were no
optional attributes.
One of the aims of supporting <virtualport> in libvirt's virtual
networks and portgroups is to allow specifying the group-wide
parameters in the network's virtualport, and merge that with the
interface's virtualport, which will have the instance-specific info
(i.e. the interfaceid or instanceid).
Additionally, the guest's interface XML shouldn't need to know what
type of network connection will be used prior to runtime - it could be
openvswitch, 802.1Qbh, 802.1Qbg, or none of the above - but should
still be able to specify instance-specific info just in case it turns
out to be applicable.
Finally, up to now, the parser for virtualport has always generated a
random instanceid/interfaceid when appropriate, making it impossible
to leave it blank (which is what's required for virtualports within a
network/portprofile definition).
This patch modifies the parser and formatter of the <virtualport>
element in the following ways:
* because most of the attributes in a virNetDevVPortProfile are fixed
size binary data with no reserved values, there is no way to embed a
"this value wasn't specified" sentinel into the existing data. To
solve this problem, the new *_specified fields in the
virNetDevVPortProfile object that were added in a previous patch of
this series are now set when the corresponding attribute is present
during the parse.
* allow parsing/formatting a <virtualport> that has no type set. In
this case, all fields are settable, but all are also optional.
* add a GENERATE_MISSING_DEFAULTS flag to the parser - if this flag is
set and an instanceid/interfaceid is expected but not provided, a
random one will be generated. This was previously the default
behavior, but is now done only for virtualports inside an
<interface> definition, not for those in <network> or <portgroup>.
* add a REQUIRE_ALL_ATTRIBUTES flag to the parser - if this flag is
set the parser will call the new
virNetDevVPortProfileCheckComplete() functions at the end of the
parser to check for any missing attributes (based on type), and
return failure if anything is missing. This used to be default
behavior. Now it is only used for the virtualport defined inside an
interface's <actual> element (by the time you've figured out the
contents of <actual>, you should have all the necessary data to fill
in the entire virtualport)
* add a REQUIRE_TYPE flag to the parser - if this flag is set, the
parser will return an error if the virtualport has no type
attribute. This also was previously the default behavior, but isn't
needed in the case of the virtualport for a type='network' interface
(i.e. the exact type isn't yet known), or the virtualport of a
portgroup (i.e. the portgroup just has modifiers for the network's
virtualport, which *does* require a type) - in those cases, the
check will be done at domain startup, once the final virtualport is
assembled (this is handled in the next patch).
2012-07-31 18:36:51 +00:00
|
|
|
<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>
|
2011-06-29 04:38:10 +00:00
|
|
|
</element>
|
|
|
|
</group>
|
|
|
|
</choice>
|
|
|
|
</define>
|
2011-07-22 14:07:23 +00:00
|
|
|
|
|
|
|
<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>
|
2012-11-16 09:37:15 +00:00
|
|
|
<optional>
|
|
|
|
<attribute name="floor">
|
|
|
|
<ref name="speed"/>
|
|
|
|
</attribute>
|
|
|
|
</optional>
|
2011-07-22 14:07:23 +00:00
|
|
|
<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>
|
2012-01-02 14:23:54 +00:00
|
|
|
|
|
|
|
<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>
|
2012-08-12 07:51:30 +00:00
|
|
|
|
|
|
|
<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>
|
2013-05-23 17:12:10 +00:00
|
|
|
<optional>
|
|
|
|
<attribute name="nativeMode">
|
|
|
|
<choice>
|
|
|
|
<value>tagged</value>
|
|
|
|
<value>untagged</value>
|
|
|
|
</choice>
|
|
|
|
</attribute>
|
|
|
|
</optional>
|
2012-08-12 07:51:30 +00:00
|
|
|
<empty/>
|
|
|
|
</element>
|
|
|
|
</oneOrMore>
|
|
|
|
</element>
|
|
|
|
</define>
|
2013-09-05 09:08:38 +00:00
|
|
|
|
|
|
|
<define name='port'>
|
|
|
|
<data type='integer'>
|
|
|
|
<param name='minInclusive'>1</param>
|
|
|
|
<param name='maxInclusive'>65535</param>
|
|
|
|
</data>
|
|
|
|
</define>
|
2015-01-14 09:51:52 +00:00
|
|
|
|
|
|
|
<!-- The (static) route element specifies a network address and gateway
|
|
|
|
address to access that network. Both the network address and
|
|
|
|
the gateway address must be specified. -->
|
2015-01-14 15:15:57 +00:00
|
|
|
<define name='route'>
|
2015-01-14 09:51:52 +00:00
|
|
|
<element name="route">
|
|
|
|
<optional>
|
|
|
|
<attribute name="family"><ref name="addr-family"/></attribute>
|
|
|
|
</optional>
|
|
|
|
<attribute name="address"><ref name="ipAddr"/></attribute>
|
|
|
|
<optional>
|
|
|
|
<choice>
|
|
|
|
<attribute name="netmask"><ref name="ipv4Addr"/></attribute>
|
|
|
|
<attribute name="prefix"><ref name="ipPrefix"/></attribute>
|
|
|
|
</choice>
|
|
|
|
</optional>
|
|
|
|
<attribute name="gateway"><ref name="ipAddr"/></attribute>
|
|
|
|
<optional>
|
|
|
|
<attribute name="metric"><ref name="unsignedInt"/></attribute>
|
|
|
|
</optional>
|
|
|
|
</element>
|
|
|
|
</define>
|
2011-06-29 04:38:10 +00:00
|
|
|
</grammar>
|