libvirt.rng 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258
  1. <?xml version="1.0"?>
  2. <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  3. <!-- We handle only document defining a domain -->
  4. <start>
  5. <ref name="domain"/>
  6. </start>
  7. <!--
  8. We handle only document defining a domain
  9. -->
  10. <define name="domain">
  11. <element name="domain">
  12. <ref name="hvs"/>
  13. <ref name="ids"/>
  14. <interleave>
  15. <ref name="os"/>
  16. <ref name="clock"/>
  17. <ref name="resources"/>
  18. <ref name="features"/>
  19. <ref name="termination"/>
  20. <optional>
  21. <ref name="devices"/>
  22. </optional>
  23. <optional>
  24. <ref name="seclabel"/>
  25. </optional>
  26. </interleave>
  27. </element>
  28. </define>
  29. <define name="seclabel">
  30. <element name="seclabel">
  31. <attribute name="model">
  32. <text/>
  33. </attribute>
  34. <attribute name="type">
  35. <choice>
  36. <value>dynamic</value>
  37. <value>static</value>
  38. </choice>
  39. </attribute>
  40. <element name="label">
  41. <text/>
  42. </element>
  43. </element>
  44. </define>
  45. <define name="hvs">
  46. <attribute name="type">
  47. <choice>
  48. <value>xen</value>
  49. <value>kvm</value>
  50. <value>kqemu</value>
  51. <value>qemu</value>
  52. <value>lxc</value>
  53. <value>openvz</value>
  54. <value>test</value>
  55. </choice>
  56. </attribute>
  57. </define>
  58. <define name="os">
  59. <choice>
  60. <ref name="osxen"/>
  61. <ref name="oshvm"/>
  62. <ref name="osexe"/>
  63. </choice>
  64. </define>
  65. <define name="osxen">
  66. <choice>
  67. <group>
  68. <optional>
  69. <ref name="bootloader"/>
  70. </optional>
  71. <element name="os">
  72. <ref name="ostypexen"/>
  73. <ref name="osbootkernel"/>
  74. </element>
  75. </group>
  76. <group>
  77. <ref name="bootloader"/>
  78. <optional>
  79. <element name="os">
  80. <ref name="ostypexen"/>
  81. <optional>
  82. <ref name="osbootkernel"/>
  83. </optional>
  84. </element>
  85. </optional>
  86. </group>
  87. </choice>
  88. </define>
  89. <define name="oshvm">
  90. <element name="os">
  91. <ref name="ostypehvm"/>
  92. <interleave>
  93. <optional>
  94. <element name="loader">
  95. <ref name="absFilePath"/>
  96. </element>
  97. </optional>
  98. <choice>
  99. <ref name="osbootkernel"/>
  100. <ref name="osbootdev"/>
  101. </choice>
  102. </interleave>
  103. </element>
  104. </define>
  105. <define name="ostypexen">
  106. <element name="type">
  107. <optional>
  108. <attribute name="arch">
  109. <choice>
  110. <value>i686</value>
  111. <value>x86_64</value>
  112. <value>ia64</value>
  113. </choice>
  114. </attribute>
  115. </optional>
  116. <optional>
  117. <attribute name="machine">
  118. <choice>
  119. <value>xenpv</value>
  120. <value>xenner</value>
  121. </choice>
  122. </attribute>
  123. </optional>
  124. <choice>
  125. <value>xen</value>
  126. <value>linux</value>
  127. </choice>
  128. </element>
  129. </define>
  130. <define name="ostypehvm">
  131. <element name="type">
  132. <optional>
  133. <choice>
  134. <ref name="hvmx86"/>
  135. <ref name="hvmmips"/>
  136. <ref name="hvmsparc"/>
  137. <ref name="hvmppc"/>
  138. </choice>
  139. </optional>
  140. <value>hvm</value>
  141. </element>
  142. </define>
  143. <define name="hvmx86">
  144. <group>
  145. <attribute name="arch">
  146. <choice>
  147. <value>i686</value>
  148. <value>x86_64</value>
  149. </choice>
  150. </attribute>
  151. <attribute name="machine">
  152. <choice>
  153. <value>xenfv</value>
  154. <value>pc</value>
  155. <value>isapc</value>
  156. </choice>
  157. </attribute>
  158. </group>
  159. </define>
  160. <define name="hvmmips">
  161. <group>
  162. <attribute name="arch">
  163. <value>mips</value>
  164. </attribute>
  165. <attribute name="machine">
  166. <value>mips</value>
  167. </attribute>
  168. </group>
  169. </define>
  170. <define name="hvmsparc">
  171. <group>
  172. <attribute name="arch">
  173. <value>sparc</value>
  174. </attribute>
  175. <attribute name="machine">
  176. <value>sun4m</value>
  177. </attribute>
  178. </group>
  179. </define>
  180. <define name="hvmppc">
  181. <group>
  182. <attribute name="arch">
  183. <value>ppc</value>
  184. </attribute>
  185. <attribute name="machine">
  186. <choice>
  187. <value>g3beige</value>
  188. <value>mac99</value>
  189. <value>prep</value>
  190. </choice>
  191. </attribute>
  192. </group>
  193. </define>
  194. <define name="osexe">
  195. <element name="os">
  196. <element name="type">
  197. <value>exe</value>
  198. </element>
  199. <interleave>
  200. <optional>
  201. <element name="init">
  202. <ref name="absFilePath"/>
  203. </element>
  204. </optional>
  205. </interleave>
  206. </element>
  207. </define>
  208. <!--
  209. The Identifiers can be:
  210. - an optional id attribute with a number on the domain element
  211. - a mandatory name
  212. - an optional uuid
  213. -->
  214. <define name="ids">
  215. <optional>
  216. <attribute name="id">
  217. <ref name="unsignedInt"/>
  218. </attribute>
  219. </optional>
  220. <interleave>
  221. <element name="name">
  222. <ref name="domainName"/>
  223. </element>
  224. <optional>
  225. <element name="uuid">
  226. <ref name="UUID"/>
  227. </element>
  228. </optional>
  229. </interleave>
  230. </define>
  231. <!--
  232. Resources usage defines the amount of memory (maximum and possibly
  233. current usage) and number of virtual CPUs used by that domain.
  234. We can't check here the rule that currentMemory <= memory
  235. -->
  236. <define name="resources">
  237. <interleave>
  238. <element name="memory">
  239. <ref name="memoryKB"/>
  240. </element>
  241. <optional>
  242. <element name="currentMemory">
  243. <ref name="memoryKB"/>
  244. </element>
  245. </optional>
  246. <optional>
  247. <element name="memoryBacking">
  248. <optional>
  249. <element name="hugepages">
  250. <empty/>
  251. </element>
  252. </optional>
  253. </element>
  254. </optional>
  255. <optional>
  256. <element name="vcpu">
  257. <optional>
  258. <attribute name="cpuset"/>
  259. </optional>
  260. <ref name="countCPU"/>
  261. </element>
  262. </optional>
  263. </interleave>
  264. </define>
  265. <define name="clock">
  266. <optional>
  267. <element name="clock">
  268. <attribute name="offset">
  269. <choice>
  270. <value>localtime</value>
  271. <value>utc</value>
  272. </choice>
  273. </attribute>
  274. <empty/>
  275. </element>
  276. </optional>
  277. </define>
  278. <!--
  279. A bootloader may be used to extract the OS information instead of
  280. defining the OS parameter in the instance. It points just to the
  281. binary or script used to extract the data from the first disk device.
  282. -->
  283. <define name="bootloader">
  284. <interleave>
  285. <element name="bootloader">
  286. <choice>
  287. <ref name="absFilePath"/>
  288. <empty/>
  289. </choice>
  290. </element>
  291. <optional>
  292. <element name="bootloader_args">
  293. <text/>
  294. </element>
  295. </optional>
  296. </interleave>
  297. </define>
  298. <define name="osbootkernel">
  299. <interleave>
  300. <element name="kernel">
  301. <ref name="absFilePath"/>
  302. </element>
  303. <optional>
  304. <element name="initrd">
  305. <ref name="absFilePath"/>
  306. </element>
  307. </optional>
  308. <optional>
  309. <element name="root">
  310. <ref name="devicePath"/>
  311. </element>
  312. </optional>
  313. <optional>
  314. <element name="cmdline">
  315. <text/>
  316. </element>
  317. </optional>
  318. </interleave>
  319. </define>
  320. <define name="osbootdev">
  321. <element name="boot">
  322. <attribute name="dev">
  323. <choice>
  324. <value>hd</value>
  325. <value>fd</value>
  326. <value>cdrom</value>
  327. <value>network</value>
  328. </choice>
  329. </attribute>
  330. <empty/>
  331. </element>
  332. </define>
  333. <define name="diskspec">
  334. <optional>
  335. <ref name="driver"/>
  336. </optional>
  337. <ref name="target"/>
  338. <optional>
  339. <element name="readonly">
  340. <empty/>
  341. </element>
  342. </optional>
  343. <optional>
  344. <element name="shareable">
  345. <empty/>
  346. </element>
  347. </optional>
  348. <optional>
  349. <element name="serial">
  350. <ref name="diskSerial"/>
  351. </element>
  352. </optional>
  353. </define>
  354. <!--
  355. A disk description can be either of type file or block
  356. The name of the attribute on the source element depends on the type
  357. -->
  358. <define name="disk">
  359. <element name="disk">
  360. <optional>
  361. <attribute name="device">
  362. <choice>
  363. <value>floppy</value>
  364. <value>disk</value>
  365. <value>cdrom</value>
  366. </choice>
  367. </attribute>
  368. </optional>
  369. <choice>
  370. <group>
  371. <attribute name="type">
  372. <value>file</value>
  373. </attribute>
  374. <interleave>
  375. <optional>
  376. <element name="source">
  377. <attribute name="file">
  378. <ref name="absFilePath"/>
  379. </attribute>
  380. <empty/>
  381. </element>
  382. </optional>
  383. <ref name="diskspec"/>
  384. </interleave>
  385. </group>
  386. <group>
  387. <attribute name="type">
  388. <value>block</value>
  389. </attribute>
  390. <interleave>
  391. <optional>
  392. <element name="source">
  393. <attribute name="dev">
  394. <ref name="deviceName"/>
  395. </attribute>
  396. <empty/>
  397. </element>
  398. </optional>
  399. <ref name="diskspec"/>
  400. </interleave>
  401. </group>
  402. <ref name="diskspec"/>
  403. </choice>
  404. </element>
  405. </define>
  406. <define name="target">
  407. <element name="target">
  408. <attribute name="dev">
  409. <ref name="deviceName"/>
  410. </attribute>
  411. <optional>
  412. <attribute name="bus">
  413. <choice>
  414. <value>ide</value>
  415. <value>fdc</value>
  416. <value>scsi</value>
  417. <value>virtio</value>
  418. <value>xen</value>
  419. <value>usb</value>
  420. <value>uml</value>
  421. </choice>
  422. </attribute>
  423. </optional>
  424. </element>
  425. </define>
  426. <!--
  427. Disk may use a special driver for access. Currently this is
  428. only defined for Xen for tap/aio and file, but will certainly be
  429. extended in the future, and libvirt doesn't look for specific values.
  430. -->
  431. <define name="driver">
  432. <element name="driver">
  433. <choice>
  434. <group>
  435. <ref name="driverFormat"/>
  436. <optional>
  437. <ref name="driverCache"/>
  438. </optional>
  439. </group>
  440. <group>
  441. <optional>
  442. <ref name="driverFormat"/>
  443. </optional>
  444. <ref name="driverCache"/>
  445. </group>
  446. </choice>
  447. <empty/>
  448. </element>
  449. </define>
  450. <define name="driverFormat">
  451. <attribute name="name">
  452. <ref name="genericName"/>
  453. </attribute>
  454. <optional>
  455. <attribute name="type">
  456. <ref name="genericName"/>
  457. </attribute>
  458. </optional>
  459. </define>
  460. <define name="driverCache">
  461. <attribute name="cache">
  462. <choice>
  463. <value>none</value>
  464. <value>writeback</value>
  465. <value>writethrough</value>
  466. </choice>
  467. </attribute>
  468. </define>
  469. <define name="filesystem">
  470. <element name="filesystem">
  471. <choice>
  472. <group>
  473. <attribute name="type">
  474. <value>file</value>
  475. </attribute>
  476. <interleave>
  477. <element name="source">
  478. <attribute name="file">
  479. <ref name="absFilePath"/>
  480. </attribute>
  481. <empty/>
  482. </element>
  483. <ref name="filesystemtgt"/>
  484. </interleave>
  485. </group>
  486. <group>
  487. <attribute name="type">
  488. <value>block</value>
  489. </attribute>
  490. <interleave>
  491. <element name="source">
  492. <attribute name="dev">
  493. <ref name="deviceName"/>
  494. </attribute>
  495. <empty/>
  496. </element>
  497. <ref name="filesystemtgt"/>
  498. </interleave>
  499. </group>
  500. <group>
  501. <attribute name="type">
  502. <value>mount</value>
  503. </attribute>
  504. <interleave>
  505. <element name="source">
  506. <attribute name="dir">
  507. <ref name="absFilePath"/>
  508. </attribute>
  509. <empty/>
  510. </element>
  511. <ref name="filesystemtgt"/>
  512. </interleave>
  513. </group>
  514. <group>
  515. <attribute name="type">
  516. <value>template</value>
  517. </attribute>
  518. <interleave>
  519. <element name="source">
  520. <attribute name="name">
  521. <ref name="genericName"/>
  522. </attribute>
  523. <empty/>
  524. </element>
  525. <ref name="filesystemtgt"/>
  526. </interleave>
  527. </group>
  528. </choice>
  529. </element>
  530. </define>
  531. <define name="filesystemtgt">
  532. <element name="target">
  533. <attribute name="dir">
  534. <ref name="absDirPath"/>
  535. </attribute>
  536. <empty/>
  537. </element>
  538. </define>
  539. <!--
  540. An interface description can either be of type bridge in which case
  541. it will use a bridging source, or of type ethernet which uses a device
  542. source and a device target instead. They both share a set of interface
  543. options. FIXME
  544. -->
  545. <define name="interface">
  546. <element name="interface">
  547. <choice>
  548. <group>
  549. <attribute name="type">
  550. <value>bridge</value>
  551. </attribute>
  552. <interleave>
  553. <optional>
  554. <element name="source">
  555. <attribute name="bridge">
  556. <ref name="deviceName"/>
  557. </attribute>
  558. <empty/>
  559. </element>
  560. </optional>
  561. <ref name="interface-options"/>
  562. </interleave>
  563. </group>
  564. <group>
  565. <attribute name="type">
  566. <value>ethernet</value>
  567. </attribute>
  568. <interleave>
  569. <optional>
  570. <element name="source">
  571. <attribute name="dev">
  572. <ref name="deviceName"/>
  573. </attribute>
  574. <empty/>
  575. </element>
  576. </optional>
  577. <ref name="interface-options"/>
  578. </interleave>
  579. </group>
  580. <group>
  581. <attribute name="type">
  582. <value>network</value>
  583. </attribute>
  584. <interleave>
  585. <element name="source">
  586. <attribute name="network">
  587. <ref name="deviceName"/>
  588. </attribute>
  589. <empty/>
  590. </element>
  591. <ref name="interface-options"/>
  592. </interleave>
  593. </group>
  594. <group>
  595. <attribute name="type">
  596. <value>user</value>
  597. </attribute>
  598. <interleave>
  599. <ref name="interface-options"/>
  600. </interleave>
  601. </group>
  602. <group>
  603. <attribute name="type">
  604. <value>internal</value>
  605. </attribute>
  606. <interleave>
  607. <element name="source">
  608. <attribute name="name">
  609. <ref name="deviceName"/>
  610. </attribute>
  611. <empty/>
  612. </element>
  613. <ref name="interface-options"/>
  614. </interleave>
  615. </group>
  616. </choice>
  617. </element>
  618. </define>
  619. <!--
  620. The interface options possible are:
  621. - the MAC address
  622. - the IP address bound to the interface
  623. - the name of the script used to set up the binding
  624. - the target device used
  625. -->
  626. <define name="interface-options">
  627. <interleave>
  628. <optional>
  629. <element name="target">
  630. <attribute name="dev">
  631. <ref name="deviceName"/>
  632. </attribute>
  633. <empty/>
  634. </element>
  635. </optional>
  636. <optional>
  637. <element name="mac">
  638. <attribute name="address">
  639. <ref name="addrMAC"/>
  640. </attribute>
  641. <empty/>
  642. </element>
  643. </optional>
  644. <optional>
  645. <element name="ip">
  646. <attribute name="address">
  647. <ref name="addrIP"/>
  648. </attribute>
  649. <empty/>
  650. </element>
  651. </optional>
  652. <optional>
  653. <element name="script">
  654. <attribute name="path">
  655. <ref name="filePath"/>
  656. </attribute>
  657. <empty/>
  658. </element>
  659. </optional>
  660. <optional>
  661. <element name="model">
  662. <attribute name="type"/>
  663. <empty/>
  664. </element>
  665. </optional>
  666. </interleave>
  667. </define>
  668. <!--
  669. An emulator description is just a path to the binary used for the task
  670. -->
  671. <define name="emulator">
  672. <element name="emulator">
  673. <ref name="absFilePath"/>
  674. </element>
  675. </define>
  676. <!--
  677. A graphic description, currently in Xen only 2 types are supported:
  678. - sdl with optional display, xauth and fullscreen
  679. - vnc with a required port and optional listen IP address, password
  680. and keymap
  681. -->
  682. <define name="graphic">
  683. <element name="graphics">
  684. <choice>
  685. <group>
  686. <attribute name="type">
  687. <value>sdl</value>
  688. </attribute>
  689. <optional>
  690. <attribute name="display">
  691. <text/>
  692. </attribute>
  693. </optional>
  694. <optional>
  695. <attribute name="xauth">
  696. <text/>
  697. </attribute>
  698. </optional>
  699. <optional>
  700. <attribute name="fullscreen">
  701. <choice>
  702. <value>yes</value>
  703. <value>no</value>
  704. </choice>
  705. </attribute>
  706. </optional>
  707. </group>
  708. <group>
  709. <attribute name="type">
  710. <value>vnc</value>
  711. </attribute>
  712. <optional>
  713. <attribute name="port">
  714. <ref name="PortNumber"/>
  715. </attribute>
  716. </optional>
  717. <optional>
  718. <attribute name="autoport">
  719. <choice>
  720. <value>yes</value>
  721. <value>no</value>
  722. </choice>
  723. </attribute>
  724. </optional>
  725. <optional>
  726. <attribute name="listen">
  727. <ref name="addrIP"/>
  728. </attribute>
  729. </optional>
  730. <optional>
  731. <attribute name="passwd">
  732. <text/>
  733. </attribute>
  734. </optional>
  735. <optional>
  736. <attribute name="keymap">
  737. <text/>
  738. </attribute>
  739. </optional>
  740. </group>
  741. <group>
  742. <attribute name="type">
  743. <value>rdp</value>
  744. </attribute>
  745. <optional>
  746. <attribute name="port">
  747. <ref name="PortNumber"/>
  748. </attribute>
  749. </optional>
  750. <optional>
  751. <attribute name="autoport">
  752. <choice>
  753. <value>yes</value>
  754. <value>no</value>
  755. </choice>
  756. </attribute>
  757. </optional>
  758. <optional>
  759. <attribute name="replaceUser">
  760. <choice>
  761. <value>yes</value>
  762. <value>no</value>
  763. </choice>
  764. </attribute>
  765. </optional>
  766. <optional>
  767. <attribute name="multiUser">
  768. <choice>
  769. <value>yes</value>
  770. <value>no</value>
  771. </choice>
  772. </attribute>
  773. </optional>
  774. <optional>
  775. <attribute name="listen">
  776. <ref name="addrIP"/>
  777. </attribute>
  778. </optional>
  779. </group>
  780. <group>
  781. <attribute name="type">
  782. <value>desktop</value>
  783. </attribute>
  784. <optional>
  785. <attribute name="display">
  786. <text/>
  787. </attribute>
  788. </optional>
  789. <optional>
  790. <attribute name="fullscreen">
  791. <choice>
  792. <value>yes</value>
  793. <value>no</value>
  794. </choice>
  795. </attribute>
  796. </optional>
  797. </group>
  798. </choice>
  799. </element>
  800. </define>
  801. <!--
  802. A graphic description, currently in Xen only 2 types are supported:
  803. - sdl with optional display, xauth and fullscreen
  804. - vnc with a required port and optional listen IP address, password
  805. and keymap
  806. -->
  807. <define name="video">
  808. <element name="video">
  809. <optional>
  810. <element name="model">
  811. <attribute name="type">
  812. <choice>
  813. <value>vga</value>
  814. <value>cirrus</value>
  815. <value>vmvga</value>
  816. <value>xen</value>
  817. <value>vbox</value>
  818. </choice>
  819. </attribute>
  820. <optional>
  821. <attribute name="vram">
  822. <ref name="unsignedInt"/>
  823. </attribute>
  824. </optional>
  825. <optional>
  826. <attribute name="heads">
  827. <ref name="unsignedInt"/>
  828. </attribute>
  829. </optional>
  830. <optional>
  831. <element name="acceleration">
  832. <optional>
  833. <attribute name="accel3d">
  834. <choice>
  835. <value>yes</value>
  836. <value>no</value>
  837. </choice>
  838. </attribute>
  839. </optional>
  840. <optional>
  841. <attribute name="accel2d">
  842. <choice>
  843. <value>yes</value>
  844. <value>no</value>
  845. </choice>
  846. </attribute>
  847. </optional>
  848. </element>
  849. </optional>
  850. </element>
  851. </optional>
  852. </element>
  853. </define>
  854. <!--
  855. When a domain terminates multiple policies can be applied depending
  856. on how it ended:
  857. -->
  858. <define name="termination">
  859. <interleave>
  860. <optional>
  861. <element name="on_reboot">
  862. <ref name="offOptions"/>
  863. </element>
  864. </optional>
  865. <optional>
  866. <element name="on_poweroff">
  867. <ref name="offOptions"/>
  868. </element>
  869. </optional>
  870. <optional>
  871. <element name="on_crash">
  872. <ref name="offOptions"/>
  873. </element>
  874. </optional>
  875. </interleave>
  876. </define>
  877. <!--
  878. Options when a domain terminates:
  879. destroy: The domain is cleaned up
  880. restart: A new domain is started in place of the old one
  881. preserve: The domain will remain in memory until it is destroyed manually
  882. rename-restart: a variant of the previous one but where the old domain is
  883. renamed before being saved to allow a restart
  884. -->
  885. <define name="offOptions">
  886. <choice>
  887. <value>destroy</value>
  888. <value>restart</value>
  889. <value>preserve</value>
  890. <value>rename-restart</value>
  891. </choice>
  892. </define>
  893. <!--
  894. Specific setup for a qemu emulated character device. Note: this
  895. definition doesn't fully specify the constraints on this node.
  896. -->
  897. <define name="qemucdev">
  898. <attribute name="type">
  899. <choice>
  900. <value>dev</value>
  901. <value>file</value>
  902. <value>pipe</value>
  903. <value>unix</value>
  904. <value>tcp</value>
  905. <value>udp</value>
  906. <value>null</value>
  907. <value>stdio</value>
  908. <value>vc</value>
  909. <value>pty</value>
  910. </choice>
  911. </attribute>
  912. <interleave>
  913. <optional>
  914. <oneOrMore>
  915. <element name="source">
  916. <optional>
  917. <attribute name="mode"/>
  918. </optional>
  919. <optional>
  920. <attribute name="path"/>
  921. </optional>
  922. <optional>
  923. <attribute name="host"/>
  924. </optional>
  925. <optional>
  926. <attribute name="service"/>
  927. </optional>
  928. <optional>
  929. <attribute name="wiremode"/>
  930. </optional>
  931. </element>
  932. </oneOrMore>
  933. </optional>
  934. <optional>
  935. <element name="protocol">
  936. <optional>
  937. <attribute name="type"/>
  938. </optional>
  939. </element>
  940. </optional>
  941. <optional>
  942. <element name="target">
  943. <optional>
  944. <attribute name="port"/>
  945. </optional>
  946. </element>
  947. </optional>
  948. </interleave>
  949. </define>
  950. <!--
  951. The description for a console
  952. just a tty device
  953. -->
  954. <define name="console">
  955. <element name="console">
  956. <choice>
  957. <group>
  958. <optional>
  959. <attribute name="tty">
  960. <ref name="devicePath"/>
  961. </attribute>
  962. </optional>
  963. <empty/>
  964. </group>
  965. <ref name="qemucdev"/>
  966. </choice>
  967. </element>
  968. </define>
  969. <define name="sound">
  970. <element name="sound">
  971. <attribute name="model">
  972. <choice>
  973. <value>sb16</value>
  974. <value>es1370</value>
  975. <value>pcspk</value>
  976. <value>ac97</value>
  977. </choice>
  978. </attribute>
  979. </element>
  980. </define>
  981. <define name="parallel">
  982. <element name="parallel">
  983. <ref name="qemucdev"/>
  984. </element>
  985. </define>
  986. <define name="serial">
  987. <element name="serial">
  988. <ref name="qemucdev"/>
  989. </element>
  990. </define>
  991. <define name="input">
  992. <element name="input">
  993. <attribute name="type">
  994. <choice>
  995. <value>tablet</value>
  996. <value>mouse</value>
  997. </choice>
  998. </attribute>
  999. <optional>
  1000. <attribute name="bus">
  1001. <choice>
  1002. <value>ps2</value>
  1003. <value>usb</value>
  1004. <value>xen</value>
  1005. </choice>
  1006. </attribute>
  1007. </optional>
  1008. </element>
  1009. </define>
  1010. <define name="hostdev">
  1011. <element name="hostdev">
  1012. <optional>
  1013. <attribute name="mode">
  1014. <choice>
  1015. <value>subsystem</value>
  1016. <value>capabilities</value>
  1017. </choice>
  1018. </attribute>
  1019. <attribute name="type">
  1020. <choice>
  1021. <value>usb</value>
  1022. <value>pci</value>
  1023. </choice>
  1024. </attribute>
  1025. <attribute name="managed">
  1026. <choice>
  1027. <value>yes</value>
  1028. <value>no</value>
  1029. </choice>
  1030. </attribute>
  1031. </optional>
  1032. <group>
  1033. <element name="source">
  1034. <choice>
  1035. <ref name="usbproduct"/>
  1036. <ref name="usbaddress"/>
  1037. <ref name="pciaddress"/>
  1038. </choice>
  1039. </element>
  1040. </group>
  1041. </element>
  1042. </define>
  1043. <define name="usbproduct">
  1044. <element name="vendor">
  1045. <attribute name="id">
  1046. <ref name="usbId"/>
  1047. </attribute>
  1048. </element>
  1049. <element name="product">
  1050. <attribute name="id">
  1051. <ref name="usbId"/>
  1052. </attribute>
  1053. </element>
  1054. </define>
  1055. <define name="usbaddress">
  1056. <element name="address">
  1057. <attribute name="bus">
  1058. <ref name="usbAddr"/>
  1059. </attribute>
  1060. <attribute name="device">
  1061. <ref name="usbAddr"/>
  1062. </attribute>
  1063. </element>
  1064. </define>
  1065. <define name="pciaddress">
  1066. <element name="address">
  1067. <optional>
  1068. <attribute name="domain">
  1069. <ref name="pciDomain"/>
  1070. </attribute>
  1071. </optional>
  1072. <attribute name="bus">
  1073. <ref name="pciBus"/>
  1074. </attribute>
  1075. <attribute name="slot">
  1076. <ref name="pciSlot"/>
  1077. </attribute>
  1078. <attribute name="function">
  1079. <ref name="pciFunc"/>
  1080. </attribute>
  1081. </element>
  1082. </define>
  1083. <!--
  1084. Devices attached to a domain.
  1085. -->
  1086. <define name="devices">
  1087. <element name="devices">
  1088. <interleave>
  1089. <optional>
  1090. <ref name="emulator"/>
  1091. </optional>
  1092. <zeroOrMore>
  1093. <choice>
  1094. <ref name="disk"/>
  1095. <ref name="filesystem"/>
  1096. <ref name="interface"/>
  1097. <ref name="input"/>
  1098. <ref name="sound"/>
  1099. <ref name="hostdev"/>
  1100. <ref name="graphic"/>
  1101. <ref name="video"/>
  1102. <ref name="console"/>
  1103. <ref name="parallel"/>
  1104. <ref name="serial"/>
  1105. </choice>
  1106. </zeroOrMore>
  1107. </interleave>
  1108. </element>
  1109. </define>
  1110. <!--
  1111. A set of optional features: PAE, APIC and ACPI support
  1112. -->
  1113. <define name="features">
  1114. <optional>
  1115. <element name="features">
  1116. <interleave>
  1117. <optional>
  1118. <element name="pae">
  1119. <empty/>
  1120. </element>
  1121. </optional>
  1122. <optional>
  1123. <element name="apic">
  1124. <empty/>
  1125. </element>
  1126. </optional>
  1127. <optional>
  1128. <element name="acpi">
  1129. <empty/>
  1130. </element>
  1131. </optional>
  1132. </interleave>
  1133. </element>
  1134. </optional>
  1135. </define>
  1136. <!--
  1137. Type library
  1138. Our unsignedInt doesn't allow a leading '+' in its lexical form
  1139. A domain name shoul be made of ascii, numbers, _-+ and is non-empty
  1140. UUID currently allows only the 32 characters strict syntax
  1141. memoryKB request at least 4Mbytes though Xen will grow bigger if too low
  1142. -->
  1143. <define name="unsignedInt">
  1144. <data type="unsignedInt">
  1145. <param name="pattern">[0-9]+</param>
  1146. </data>
  1147. </define>
  1148. <define name="countCPU">
  1149. <data type="unsignedShort">
  1150. <param name="pattern">[0-9]+</param>
  1151. <param name="minInclusive">1</param>
  1152. </data>
  1153. </define>
  1154. <define name="PortNumber">
  1155. <data type="short">
  1156. <param name="minInclusive">-1</param>
  1157. </data>
  1158. </define>
  1159. <define name="memoryKB">
  1160. <data type="unsignedInt">
  1161. <param name="pattern">[0-9]+</param>
  1162. <param name="minInclusive">4000</param>
  1163. </data>
  1164. </define>
  1165. <define name="domainName">
  1166. <data type="string">
  1167. <param name="pattern">[A-Za-z0-9_\.\+\-&amp;:/]+</param>
  1168. </data>
  1169. </define>
  1170. <define name="diskSerial">
  1171. <data type="string">
  1172. <param name="pattern">[A-Za-z0-9_\.\+\-]+</param>
  1173. </data>
  1174. </define>
  1175. <define name="genericName">
  1176. <data type="string">
  1177. <param name="pattern">[a-zA-Z0-9_\+\-]+</param>
  1178. </data>
  1179. </define>
  1180. <define name="UUID">
  1181. <choice>
  1182. <data type="string">
  1183. <param name="pattern">[a-fA-F0-9]{32}</param>
  1184. </data>
  1185. <data type="string">
  1186. <param name="pattern">[a-fA-F0-9]{8}\-([a-fA-F0-9]{4}\-){3}[a-fA-F0-9]{12}</param>
  1187. </data>
  1188. </choice>
  1189. </define>
  1190. <define name="filePath">
  1191. <data type="string">
  1192. <param name="pattern">[a-zA-Z0-9_\.\+\-&amp;/%]+</param>
  1193. </data>
  1194. </define>
  1195. <define name="absFilePath">
  1196. <data type="string">
  1197. <param name="pattern">/[a-zA-Z0-9_\.\+\-&amp;/%]+</param>
  1198. </data>
  1199. </define>
  1200. <define name="absDirPath">
  1201. <data type="string">
  1202. <param name="pattern">/[a-zA-Z0-9_\.\+\-&amp;/%]*</param>
  1203. </data>
  1204. </define>
  1205. <define name="devicePath">
  1206. <data type="string">
  1207. <param name="pattern">/[a-zA-Z0-9_\+\-/%]+</param>
  1208. </data>
  1209. </define>
  1210. <define name="deviceName">
  1211. <data type="string">
  1212. <param name="pattern">[a-zA-Z0-9_\.\-:/]+</param>
  1213. </data>
  1214. </define>
  1215. <define name="addrMAC">
  1216. <data type="string">
  1217. <param name="pattern">([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}</param>
  1218. </data>
  1219. </define>
  1220. <define name="addrIP">
  1221. <data type="string">
  1222. <param name="pattern">([0-2]?[0-9]?[0-9]\.){3}[0-2]?[0-9]?[0-9]</param>
  1223. </data>
  1224. </define>
  1225. <define name="usbId">
  1226. <data type="string">
  1227. <param name="pattern">(0x)?[0-9a-fA-F]{1,4}</param>
  1228. </data>
  1229. </define>
  1230. <define name="usbAddr">
  1231. <data type="string">
  1232. <param name="pattern">(0x)?[0-9a-fA-F]{1,3}</param>
  1233. </data>
  1234. </define>
  1235. <define name="pciDomain">
  1236. <data type="string">
  1237. <param name="pattern">(0x)?[0-9a-fA-F]{1,4}</param>
  1238. </data>
  1239. </define>
  1240. <define name="pciBus">
  1241. <data type="string">
  1242. <param name="pattern">(0x)?[0-9a-fA-F]{1,2}</param>
  1243. </data>
  1244. </define>
  1245. <define name="pciSlot">
  1246. <data type="string">
  1247. <param name="pattern">(0x)?[0-1]?[0-9a-fA-F]</param>
  1248. </data>
  1249. </define>
  1250. <define name="pciFunc">
  1251. <data type="string">
  1252. <param name="pattern">(0x)?[0-7]</param>
  1253. </data>
  1254. </define>
  1255. </grammar>