qubes.rng 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  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. <zeroOrMore>
  188. <element name="option">
  189. <doc:description>
  190. Options
  191. </doc:description>
  192. <attribute name="name">
  193. <doc:description>
  194. Option name.
  195. </doc:description>
  196. <data type="string">
  197. <param name="pattern">[a-z0-9_-]+</param>
  198. </data>
  199. </attribute>
  200. <data type="string">
  201. </data>
  202. </element>
  203. </zeroOrMore>
  204. </element>
  205. </oneOrMore>
  206. </element>
  207. </zeroOrMore>
  208. <optional>
  209. <element name="tags">
  210. <doc:description>
  211. Container for user-defined tags.
  212. </doc:description>
  213. <oneOrMore>
  214. <element name="tag">
  215. <doc:description>
  216. Tag value.
  217. Tags are not used anywhere by qubes core, they
  218. are for users reference. In the future they
  219. will be available for use in policies.
  220. </doc:description>
  221. <attribute name="name">
  222. <doc:description>
  223. Name of the tag.
  224. </doc:description>
  225. <data type="string">
  226. <param name="pattern">[a-z0-9_-]+</param>
  227. </data>
  228. </attribute>
  229. <data type="string" />
  230. </element>
  231. </oneOrMore>
  232. </element>
  233. </optional>
  234. <!-- TODO: policy, incl. firewall -->
  235. </element>
  236. </define>
  237. <define name="properties">
  238. <element name="properties">
  239. <doc:description>
  240. Container for properties.
  241. </doc:description>
  242. <zeroOrMore>
  243. <element name="property">
  244. <doc:description>
  245. One property and its value specified either directly
  246. (as text contained in this tag) or as reference to
  247. another XML element in the tree (by ``ref=``
  248. attribute). How it is saved, it depends on particular
  249. property.
  250. </doc:description>
  251. <attribute name="name">
  252. <doc:description>
  253. Property name.
  254. </doc:description>
  255. <data type="string">
  256. <param name="pattern">[a-z0-9_]+</param>
  257. </data>
  258. </attribute>
  259. <choice>
  260. <attribute name="ref">
  261. <doc:description>
  262. Alternative property value, by reference to another XML element.
  263. </doc:description>
  264. <!-- TODO: IDREF (Schematron?) -->
  265. <data type="string" />
  266. </attribute>
  267. <data type="string" />
  268. </choice>
  269. </element>
  270. </zeroOrMore>
  271. </element>
  272. </define>
  273. </grammar>
  274. <!--
  275. vim: ts=4 sw=4 et
  276. -->