summaryrefslogtreecommitdiffstats
path: root/src/main/resources/libvirt/rng/networkport.rng
blob: 14db949578f46bff02d23edae1b4f4a6b204951d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<?xml version="1.0"?>
<!-- A Relax NG schema for the libvirt network port XML format -->
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
         datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <include href="basictypes.rng"/>
  <include href="networkcommon.rng"/>

  <start>
    <ref name="networkport"/>
  </start>

  <define name="networkport">
    <element name="networkport">
      <interleave>
        <element name="uuid">
          <ref name="UUID"/>
        </element>
        <ref name="owner"/>
        <ref name="mac"/>
        <optional>
          <ref name="group"/>
        </optional>
        <optional>
          <ref name="rxfilters"/>
        </optional>
        <optional>
          <ref name="virtualPortProfile"/>
        </optional>
        <optional>
          <ref name="bandwidth"/>
        </optional>
        <optional>
          <ref name="vlan"/>
        </optional>
        <optional>
          <ref name="portOptions"/>
        </optional>
        <optional>
          <ref name="plug"/>
        </optional>
      </interleave>
    </element>
  </define>

  <define name="owner">
    <element name="owner">
      <interleave>
        <element name="name">
          <text/>
        </element>
        <element name="uuid">
          <ref name="UUID"/>
        </element>
      </interleave>
    </element>
  </define>

  <define name="mac">
    <element name="mac">
      <attribute name="address">
        <ref name="uniMacAddr"/>
      </attribute>
      <empty/>
    </element>
  </define>

  <define name="group">
    <element name="group">
      <ref name="deviceName"/>
    </element>
  </define>

  <define name="rxfilters">
    <element name="rxfilters">
      <attribute name="trustGuest">
        <ref name="virYesNo"/>
      </attribute>
    </element>
  </define>

  <define name="plug">
    <element name="plug">
      <choice>
        <ref name="plugnetwork"/>
        <ref name="plugbridge"/>
        <ref name="plugdirect"/>
        <ref name="plughostdevpci"/>
      </choice>
    </element>
  </define>

  <define name="plugnetwork">
    <attribute name="type">
      <value>network</value>
    </attribute>
    <attribute name="bridge">
      <ref name="deviceName"/>
    </attribute>
    <optional>
      <attribute name="macTableManager">
        <ref name="macTableManager"/>
      </attribute>
    </optional>
  </define>

  <define name="plugbridge">
    <attribute name="type">
      <value>bridge</value>
    </attribute>
    <attribute name="bridge">
      <ref name="deviceName"/>
    </attribute>
    <optional>
      <attribute name="macTableManager">
        <ref name="macTableManager"/>
      </attribute>
    </optional>
  </define>

  <define name="plugdirect">
    <attribute name="type">
      <value>direct</value>
    </attribute>
    <attribute name="dev">
      <ref name="deviceName"/>
    </attribute>
    <attribute name="mode">
      <choice>
        <value>bridge</value>
        <value>passthrough</value>
        <value>private</value>
        <value>vepa</value>
      </choice>
    </attribute>
  </define>

  <define name="plughostdevpci">
    <attribute name="type">
      <value>hostdev-pci</value>
    </attribute>
    <optional>
      <attribute name="managed">
        <ref name="virYesNo"/>
      </attribute>
    </optional>
    <interleave>
      <optional>
        <element name="driver">
          <attribute name="name">
            <choice>
              <value>kvm</value>
              <value>vfio</value>
            </choice>
          </attribute>
          <empty/>
        </element>
      </optional>
      <element name="address">
        <ref name="pciaddress"/>
      </element>
    </interleave>
  </define>

</grammar>