formatcaps.html.in 7.8 KB
Newer Older
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE html>
3
<html xmlns="http://www.w3.org/1999/xhtml">
4 5 6
  <body>
    <h1>Driver capabilities XML format</h1>

7 8
    <ul id="toc"></ul>

9
    <h2><a id="elements">Element and attribute overview</a></h2>
10 11 12 13 14 15

    <p>As new virtualization engine support gets added to libvirt, and to
    handle cases like QEMU supporting a variety of emulations, a query
    interface has been added in 0.2.1 allowing to list the set of supported
    virtualization capabilities on the host:</p>

16
    <pre>char * virConnectGetCapabilities (virConnectPtr conn);</pre>
17 18 19 20 21 22 23

    <p>The value returned is an XML document listing the virtualization
    capabilities of the host and virtualization engine to which
    <code>@conn</code> is connected. One can test it using <code>virsh</code>
    command line tool command '<code>capabilities</code>', it dumps the XML
    associated to the current connection. </p>

Y
Yuri Chornoivan 已提交
24
    <p>As can be seen in the <a href="#elementExamples">example</a>, the
25 26 27 28 29 30
    capabilities XML consists of the <code>capabilities</code> element which
    have exactly one <code>host</code> child element to report information on
    host capabilities, and zero or more <code>guest</code> element to express
    the set of architectures the host can run at the moment.</p>


31
    <h3><a id="elementHost">Host capabilities</a></h3>
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

    <p>The <code>&lt;host/&gt;</code> element consists of the following child
    elements:</p>
    <dl>
      <dt><code>uuid</code></dt>
      <dd>The host UUID.</dd>

      <dt><code>cpu</code></dt>
      <dd>The host CPU architecture and features.</dd>

      <dt><code>power_management</code></dt>
      <dd>whether host is capable of memory suspend, disk hibernation, or
      hybrid suspend.</dd>

      <dt><code>migration</code></dt>
      <dd>This element exposes information on the hypervisor's migration
      capabilities, like live migration, supported URI transports, and so
      on.</dd>

      <dt><code>topology</code></dt>
      <dd>This element embodies the host internal topology. Management
      applications may want to learn this information when orchestrating new
      guests - e.g. due to reduce inter-NUMA node transfers.</dd>

      <dt><code>secmodel</code></dt>
      <dd>To find out default security labels for different security models you
      need to parse this element. In contrast with the former elements, this is
      repeated for each security model the libvirt daemon currently supports.
      </dd>
    </dl>


64
    <h3><a id="elementGuest">Guest capabilities</a></h3>
65 66 67 68 69 70 71 72 73 74 75

    <p>While the <a href="#elementHost">previous section</a> aims at host
    capabilities, this one focuses on capabilities available to a guest
    using a given hypervisor. The <code>&lt;guest/&gt;</code> element will
    typically wrap up the following elements:</p>

    <dl>
        <dt><code>os_type</code></dt>
        <dd>This expresses what kind of operating system the hypervisor
        is able to run. Possible values are:
        <dl>
76
          <dt><code>xen</code></dt>
77 78
          <dd>for XEN</dd>

79
          <dt><code>linux</code></dt>
80 81
          <dd>legacy alias for <code>xen</code></dd>

82
          <dt><code>hvm</code></dt>
83 84
          <dd>Unmodified operating system</dd>

85
          <dt><code>exe</code></dt>
86 87
          <dd>Container based virtualization</dd>

88
          <dt><code>uml</code></dt>
89 90 91 92 93 94 95 96 97
          <dd>User Mode Linux</dd>
        </dl>
        </dd>

        <dt><code>arch</code></dt>
        <dd>This element brings some information on supported guest architecture.</dd>

        <dt><code>features</code></dt>
        <dd>This optional element encases possible features that can be used
98 99
          with a guest of described type.  Possible subelements are:
          <dl>
100
            <dt><code>pae</code></dt><dd>If present, 32-bit guests can use PAE
101 102
              address space extensions, <span class="since">since
              0.4.1</span></dd>
103
            <dt><code>nonpae</code></dt><dd>If present, 32-bit guests can be run
104 105
              without requiring PAE, <span class="since">since
              0.4.1</span></dd>
106
            <dt><code>ia64_be</code></dt><dd>If present, IA64 guests can be run in
107
              big-endian mode, <span class="since">since 0.4.1</span></dd>
108
            <dt><code>acpi</code></dt><dd>If this element is present,
109 110 111 112 113
              the <code>default</code> attribute describes whether the
              hypervisor exposes ACPI to the guest by default, and
              the <code>toggle</code> attribute describes whether the
              user can override this
              default. <span class="since">Since 0.4.1</span></dd>
114
            <dt><code>apic</code></dt><dd>If this element is present,
115 116 117 118 119
              the <code>default</code> attribute describes whether the
              hypervisor exposes APIC to the guest by default, and
              the <code>toggle</code> attribute describes whether the
              user can override this
              default. <span class="since">Since 0.4.1</span></dd>
120
            <dt><code>cpuselection</code></dt><dd>If this element is present, the
121 122 123 124
              hypervisor supports the <code>&lt;cpu&gt;</code> element
              within a domain definition for fine-grained control over
              the CPU presented to the
              guest. <span class="since">Since 0.7.5</span></dd>
125
            <dt><code>deviceboot</code></dt><dd>If this element is present,
126 127 128 129
              the <code>&lt;boot order='...'/&gt;</code> element can
              be used inside devices, rather than the older boot
              specification by category. <span class="since">Since
              0.8.8</span></dd>
130
            <dt><code>disksnapshot</code></dt><dd>If this element is present,
131 132 133 134 135 136 137 138
              the <code>default</code> attribute describes whether
              external disk snapshots are supported.  If absent,
              external snapshots may still be supported, but it
              requires attempting the API and checking for an error to
              find out for sure. <span class="since">Since
              1.2.3</span></dd>
          </dl>
        </dd>
139 140
    </dl>

141
    <h3><a id="elementExamples">Examples</a></h3>
142 143 144 145 146 147

    <p>For example, in the case of a 64-bit machine with hardware
    virtualization capabilities enabled in the chip and
    BIOS you will see:</p>

    <pre>&lt;capabilities&gt;
148 149 150 151 152 153
  <span style="color: #E50000">&lt;host&gt;
    &lt;cpu&gt;
      &lt;arch&gt;x86_64&lt;/arch&gt;
      &lt;features&gt;
        &lt;vmx/&gt;
      &lt;/features&gt;
154
      &lt;model&gt;core2duo&lt;/model&gt;
J
Jiri Denemark 已提交
155
      &lt;vendor&gt;Intel&lt;/vendor&gt;
156 157 158 159
      &lt;topology sockets="1" cores="2" threads="1"/&gt;
      &lt;feature name="lahf_lm"/&gt;
      &lt;feature name='xtpr'/&gt;
      ...
160
    &lt;/cpu&gt;
161
    &lt;power_management&gt;
162 163 164
      &lt;suspend_mem/&gt;
      &lt;suspend_disk/&gt;
      &lt;suspend_hybrid/&gt;
165
    &lt;/power_management&gt;
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
  &lt;/host&gt;</span>

  &lt;!-- xen-3.0-x86_64 --&gt;
  <span style="color: #0000E5">&lt;guest&gt;
    &lt;os_type&gt;xen&lt;/os_type&gt;
    &lt;arch name="x86_64"&gt;
      &lt;wordsize&gt;64&lt;/wordsize&gt;
      &lt;domain type="xen"&gt;&lt;/domain&gt;
      &lt;emulator&gt;/usr/lib64/xen/bin/qemu-dm&lt;/emulator&gt;
    &lt;/arch&gt;
    &lt;features&gt;
    &lt;/features&gt;
  &lt;/guest&gt;</span>

  &lt;!-- hvm-3.0-x86_32 --&gt;
  <span style="color: #00B200">&lt;guest&gt;
    &lt;os_type&gt;hvm&lt;/os_type&gt;
    &lt;arch name="i686"&gt;
      &lt;wordsize&gt;32&lt;/wordsize&gt;
      &lt;domain type="xen"&gt;&lt;/domain&gt;
      &lt;emulator&gt;/usr/lib/xen/bin/qemu-dm&lt;/emulator&gt;
      &lt;machine&gt;pc&lt;/machine&gt;
      &lt;machine&gt;isapc&lt;/machine&gt;
      &lt;loader&gt;/usr/lib/xen/boot/hvmloader&lt;/loader&gt;
    &lt;/arch&gt;
    &lt;features&gt;
192
      &lt;cpuselection/&gt;
193
      &lt;deviceboot/&gt;
194 195 196 197 198 199
    &lt;/features&gt;
  &lt;/guest&gt;</span>
  ...
&lt;/capabilities&gt;</pre>
  </body>
</html>