cputypes.rng 4.3 KB
Newer Older
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
<?xml version="1.0"?>
<!-- CPU-related definitions used in multiple grammars -->
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
         datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">

  <define name="cpuMode">
    <attribute name="mode">
      <choice>
        <value>custom</value>
        <value>host-model</value>
        <value>host-passthrough</value>
      </choice>
    </attribute>
  </define>

  <define name="cpuMatch">
    <attribute name="match">
      <choice>
        <value>minimum</value>
        <value>exact</value>
        <value>strict</value>
      </choice>
    </attribute>
  </define>

26 27 28 29 30 31 32 33 34 35
  <define name="cpuCheck">
    <attribute name="check">
      <choice>
        <value>none</value>
        <value>partial</value>
        <value>full</value>
      </choice>
    </attribute>
  </define>

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 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
  <define name="cpuModel">
    <element name="model">
      <optional>
        <attribute name="fallback">
          <choice>
            <value>allow</value>
            <value>forbid</value>
          </choice>
        </attribute>
      </optional>
      <optional>
        <attribute name="vendor_id">
          <data type="string">
            <param name='pattern'>[^,]{12}</param>
          </data>
        </attribute>
      </optional>
      <choice>
        <text/>
        <empty/>
      </choice>
    </element>
  </define>

  <define name="cpuVendor">
    <element name="vendor">
      <text/>
    </element>
  </define>

  <define name="cpuFeature">
    <element name="feature">
      <attribute name="policy">
        <choice>
          <value>force</value>
          <value>require</value>
          <value>optional</value>
          <value>disable</value>
          <value>forbid</value>
        </choice>
      </attribute>
      <attribute name="name">
        <ref name="featureName"/>
      </attribute>
      <empty/>
    </element>
  </define>

  <define name="cpuTopology">
    <element name="topology">
      <attribute name="sockets">
        <ref name="positiveInteger"/>
      </attribute>
      <attribute name="cores">
        <ref name="positiveInteger"/>
      </attribute>
      <attribute name="threads">
        <ref name="positiveInteger"/>
      </attribute>
    </element>
  </define>

  <define name="cpuNuma">
    <element name="numa">
      <oneOrMore>
        <ref name="numaCell"/>
      </oneOrMore>
    </element>
  </define>

  <define name="numaCell">
    <element name="cell">
      <optional>
        <attribute name="id">
          <ref name="unsignedInt"/>
        </attribute>
      </optional>
      <attribute name="cpus">
        <ref name="cpuset"/>
      </attribute>
      <attribute name="memory">
        <ref name="memoryKB"/>
      </attribute>
      <optional>
        <attribute name="unit">
          <ref name="unit"/>
        </attribute>
      </optional>
      <optional>
        <attribute name="memAccess">
          <choice>
            <value>shared</value>
            <value>private</value>
          </choice>
        </attribute>
      </optional>
132 133 134 135 136
      <optional>
        <attribute name="discard">
          <ref name="virYesNo"/>
        </attribute>
      </optional>
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
      <optional>
        <element name="distances">
          <oneOrMore>
            <ref name="numaDistance"/>
          </oneOrMore>
        </element>
      </optional>
    </element>
  </define>

  <define name="numaDistance">
    <element name="sibling">
      <attribute name="id">
        <ref name="unsignedInt"/>
      </attribute>
      <attribute name="value">
        <ref name="numaDistanceValue"/>
      </attribute>
155 156 157 158 159 160 161 162 163 164 165 166 167
    </element>
  </define>

  <!-- Memory as an attribute is in KiB, no way to express a unit -->
  <define name="memoryKB">
    <data type="unsignedLong"/>
  </define>
  <define name="featureName">
    <data type="string">
      <param name='pattern'>[a-zA-Z0-9\-_\.]+</param>
    </data>
  </define>

168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188
  <define name="cpuCache">
    <element name="cache">
      <optional>
        <attribute name="level">
          <choice>
            <value>1</value>
            <value>2</value>
            <value>3</value>
          </choice>
        </attribute>
      </optional>
      <attribute name="mode">
        <choice>
          <value>emulate</value>
          <value>passthrough</value>
          <value>disable</value>
        </choice>
      </attribute>
    </element>
  </define>

189
</grammar>