summaryrefslogtreecommitdiffstats
path: root/src/main/resources/libvirt/rng/domaincheckpoint.rng
blob: 72c41862355303d9915382a3c63fbb30e6624741 (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
<?xml version="1.0"?>
<!-- A Relax NG schema for the libvirt domain checkpoint properties XML format -->
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <start>
    <ref name="domaincheckpoint"/>
  </start>

  <include href="domaincommon.rng"/>

  <define name="domaincheckpoint">
    <element name="domaincheckpoint">
      <interleave>
        <optional>
          <element name="name">
            <ref name="checkpointName"/>
          </element>
        </optional>
        <optional>
          <element name="description">
            <text/>
          </element>
        </optional>
        <optional>
          <element name="creationTime">
            <ref name="unsignedLong"/>
          </element>
        </optional>
        <optional>
          <element name="disks">
            <oneOrMore>
              <ref name="diskcheckpoint"/>
            </oneOrMore>
          </element>
        </optional>
        <optional>
          <!-- Nested grammar ensures that any of our overrides of
               storagecommon/domaincommon defines do not conflict
               with any domain.rng overrides.  -->
          <grammar>
            <include href="domain.rng"/>
          </grammar>
        </optional>
        <optional>
          <element name="parent">
            <element name="name">
              <ref name="checkpointName"/>
            </element>
          </element>
        </optional>
      </interleave>
    </element>
  </define>

  <define name="diskcheckpoint">
    <element name="disk">
      <attribute name="name">
        <choice>
          <ref name="diskTargetDev"/>
          <ref name="absFilePath"/>
        </choice>
      </attribute>
      <choice>
        <attribute name="checkpoint">
          <value>no</value>
        </attribute>
        <group>
          <optional>
            <attribute name="checkpoint">
              <value>bitmap</value>
            </attribute>
          </optional>
          <optional>
            <attribute name="bitmap">
              <text/>
            </attribute>
          </optional>
          <optional>
            <attribute name="size">
              <ref name="unsignedLong"/>
            </attribute>
          </optional>
        </group>
      </choice>
    </element>
  </define>

  <define name="checkpointName">
    <data type="string">
      <!-- Notably: no leading "." and no embedded "/" or newline -->
      <param name="pattern">[a-zA-Z0-9_\-][a-zA-Z0-9_\-.]*</param>
    </data>
  </define>

</grammar>