qubes.rng 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  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. This tag should contain some
  170. identifier, format of which depends on
  171. particular device class.
  172. </doc:description>
  173. <!-- TODO: pattern dependent on class! -->
  174. <data type="string">
  175. <param name="pattern">[0-9a-f]{2}:[0-9a-f]{2}.[0-9a-f]{2}</param>
  176. </data>
  177. </element>
  178. </oneOrMore>
  179. </element>
  180. </zeroOrMore>
  181. <optional>
  182. <element name="tags">
  183. <doc:description>
  184. Container for user-defined tags.
  185. </doc:description>
  186. <oneOrMore>
  187. <element name="tag">
  188. <doc:description>
  189. Tag value.
  190. Tags are not used anywhere by qubes core, they
  191. are for users reference. In the future they
  192. will be available for use in policies.
  193. </doc:description>
  194. <attribute name="name">
  195. <doc:description>
  196. Name of the tag.
  197. </doc:description>
  198. <data type="string">
  199. <param name="pattern">[a-z0-9_-]+</param>
  200. </data>
  201. </attribute>
  202. <data type="string" />
  203. </element>
  204. </oneOrMore>
  205. </element>
  206. </optional>
  207. <!-- TODO: policy, incl. firewall -->
  208. </element>
  209. </define>
  210. <define name="properties">
  211. <element name="properties">
  212. <doc:description>
  213. Container for properties.
  214. </doc:description>
  215. <zeroOrMore>
  216. <element name="property">
  217. <doc:description>
  218. One property and its value specified either directly
  219. (as text contained in this tag) or as reference to
  220. another XML element in the tree (by ``ref=``
  221. attribute). How it is saved, it depends on particular
  222. property.
  223. </doc:description>
  224. <attribute name="name">
  225. <doc:description>
  226. Property name.
  227. </doc:description>
  228. <data type="string">
  229. <param name="pattern">[a-z0-9_]+</param>
  230. </data>
  231. </attribute>
  232. <choice>
  233. <attribute name="ref">
  234. <doc:description>
  235. Alternative property value, by reference to another XML element.
  236. </doc:description>
  237. <!-- TODO: IDREF (Schematron?) -->
  238. <data type="string" />
  239. </attribute>
  240. <data type="string" />
  241. </choice>
  242. </element>
  243. </zeroOrMore>
  244. </element>
  245. </define>
  246. </grammar>
  247. <!--
  248. vim: ts=4 sw=4 et
  249. -->