qubes.rng 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!--
  3. The Qubes OS Project, http://www.qubes-os.org
  4. Copyright (C) 2015 Wojtek Porczyk <woju@invisiblethingslab.com>
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. -->
  17. <!--
  18. This is main specification of qubes.xml in RelaxNG. It should not <include> any
  19. other file. If you need to extract some part of specification, just put the part
  20. in question in separate <define> and create small boilerplate schema like this:
  21. <?xml version="1.0" encoding="utf-8" ?>
  22. <grammar xmlns="http://relaxng.org/ns/structure/1.0">
  23. <include href="qubes.rng">
  24. <start>
  25. <ref name="domain" />
  26. </start>
  27. </include>
  28. </grammar>
  29. Don't forget to put <start> *inside* the <include>. If you'd put it outside,
  30. the parser will complain about missing combine= attribute on the second <start>.
  31. -->
  32. <grammar xmlns="http://relaxng.org/ns/structure/1.0"
  33. xmlns:q="http://qubes-os.org/qubes/3"
  34. xmlns:doc="http://qubes-os.org/qubes-doc/1"
  35. datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  36. <start>
  37. <element name="qubes">
  38. <doc:description>
  39. This is root element of whole qubes tree.
  40. </doc:description>
  41. <attribute name="version">
  42. <doc:description>
  43. Specifies minimal Qubes OS version.
  44. </doc:description>
  45. <value>3.0</value>
  46. <!--
  47. <data type="decimal">
  48. <param name="fractionDigits">1</param>
  49. <param name="minInclusive">0</param>
  50. </data>
  51. -->
  52. </attribute>
  53. <ref name="properties" />
  54. <element name="labels">
  55. <doc:description>
  56. Container for labels.
  57. </doc:description>
  58. <oneOrMore>
  59. <element name="label">
  60. <doc:description>
  61. Label which can be used by domain. One choice of
  62. colour for padlock icon.
  63. </doc:description>
  64. <attribute name="id">
  65. <doc:description>
  66. XML id attribute used for cross-referencing in
  67. properties' ``ref`` attribute.
  68. </doc:description>
  69. <!-- TODO this should be "label-" + name -->
  70. <data type="string">
  71. <param name="pattern">label-[0-9]+</param>
  72. </data>
  73. </attribute>
  74. <optional>
  75. <attribute name="color">
  76. <doc:description>
  77. Label's colour, HTML-like.
  78. </doc:description>
  79. <data type="string">
  80. <param name="pattern">#[0-9a-f]{6}</param>
  81. </data>
  82. </attribute>
  83. </optional>
  84. <data type="string">
  85. <param name="pattern">[a-z0-9_-]+</param>
  86. </data>
  87. </element>
  88. </oneOrMore>
  89. </element>
  90. <element name="domains">
  91. <doc:description>
  92. Container for domains.
  93. </doc:description>
  94. <zeroOrMore>
  95. <ref name="domain" />
  96. </zeroOrMore>
  97. </element>
  98. </element>
  99. </start>
  100. <define name="domain">
  101. <element name="domain">
  102. <doc:description>
  103. One Qubes domain.
  104. </doc:description>
  105. <attribute name="class">
  106. <doc:description>
  107. Type of the domain. This specifies Python's class that is
  108. used for instantiation of this VM.
  109. </doc:description>
  110. <data type="string" />
  111. </attribute>
  112. <attribute name="id">
  113. <doc:description>
  114. XML id attribute used for cross-referencing in properties'
  115. ``ref`` attribute.
  116. <!-- TODO this should be "domain-" + domain's name -->
  117. </doc:description>
  118. <data type="string">
  119. <param name="pattern">domain-[0-9]+</param>
  120. </data>
  121. </attribute>
  122. <ref name="properties" />
  123. <optional>
  124. <element name="features">
  125. <doc:description>
  126. Container for features.
  127. </doc:description>
  128. <oneOrMore>
  129. <element name="feature">
  130. <doc:description>
  131. One feature of this domain.
  132. </doc:description>
  133. <attribute name="name">
  134. <doc:description>
  135. Name of the feature.
  136. </doc:description>
  137. <data type="string">
  138. <param name="pattern">[a-z0-9_-]+</param>
  139. </data>
  140. </attribute>
  141. <data type="string">
  142. <param name="pattern">[a-z0-9_-]*</param>
  143. </data>
  144. </element>
  145. </oneOrMore>
  146. </element>
  147. </optional>
  148. <zeroOrMore>
  149. <element name="devices">
  150. <doc:description>
  151. Container for devices of particular class.
  152. </doc:description>
  153. <attribute name="class">
  154. <doc:description>
  155. Class of devices in this container. Currently the
  156. only supported is ``pci``.
  157. </doc:description>
  158. <!-- TODO: class can be specified only once -->
  159. <value>pci</value>
  160. <!--
  161. <data type="string">
  162. <param name="pattern">[a-z0-9]+</param>
  163. </data>
  164. -->
  165. </attribute>
  166. <oneOrMore>
  167. <element name="device">
  168. <doc:description>
  169. One device. It's identified by by a pair of
  170. backend domain and some identifier (device class
  171. dependant).
  172. </doc:description>
  173. <attribute name="backend-domain">
  174. <doc:description>
  175. Backend domain name.
  176. </doc:description>
  177. <data type="string">
  178. <param name="pattern">[a-z0-9_]+</param>
  179. </data>
  180. </attribute>
  181. <attribute name="id">
  182. <!-- TODO: pattern dependent on class! -->
  183. <data type="string">
  184. <param name="pattern">[0-9a-f]{2}:[0-9a-f]{2}.[0-9a-f]{2}</param>
  185. </data>
  186. </attribute>
  187. </element>
  188. </oneOrMore>
  189. </element>
  190. </zeroOrMore>
  191. <optional>
  192. <element name="tags">
  193. <doc:description>
  194. Container for user-defined tags.
  195. </doc:description>
  196. <oneOrMore>
  197. <element name="tag">
  198. <doc:description>
  199. Tag value.
  200. Tags are not used anywhere by qubes core, they
  201. are for users reference. In the future they
  202. will be available for use in policies.
  203. </doc:description>
  204. <attribute name="name">
  205. <doc:description>
  206. Name of the tag.
  207. </doc:description>
  208. <data type="string">
  209. <param name="pattern">[a-z0-9_-]+</param>
  210. </data>
  211. </attribute>
  212. <data type="string" />
  213. </element>
  214. </oneOrMore>
  215. </element>
  216. </optional>
  217. <!-- TODO: policy, incl. firewall -->
  218. </element>
  219. </define>
  220. <define name="properties">
  221. <element name="properties">
  222. <doc:description>
  223. Container for properties.
  224. </doc:description>
  225. <zeroOrMore>
  226. <element name="property">
  227. <doc:description>
  228. One property and its value specified either directly
  229. (as text contained in this tag) or as reference to
  230. another XML element in the tree (by ``ref=``
  231. attribute). How it is saved, it depends on particular
  232. property.
  233. </doc:description>
  234. <attribute name="name">
  235. <doc:description>
  236. Property name.
  237. </doc:description>
  238. <data type="string">
  239. <param name="pattern">[a-z0-9_]+</param>
  240. </data>
  241. </attribute>
  242. <choice>
  243. <attribute name="ref">
  244. <doc:description>
  245. Alternative property value, by reference to another XML element.
  246. </doc:description>
  247. <!-- TODO: IDREF (Schematron?) -->
  248. <data type="string" />
  249. </attribute>
  250. <data type="string" />
  251. </choice>
  252. </element>
  253. </zeroOrMore>
  254. </element>
  255. </define>
  256. </grammar>
  257. <!--
  258. vim: ts=4 sw=4 et
  259. -->