~ubuntu-branches/ubuntu/natty/libvirt/natty-security

« back to all changes in this revision

Viewing changes to docs/formatdomain.html

  • Committer: Bazaar Package Importer
  • Author(s): Serge Hallyn
  • Date: 2011-02-23 09:05:46 UTC
  • mfrom: (1.2.8 upstream) (3.4.25 sid)
  • Revision ID: james.westby@ubuntu.com-20110223090546-4pwmrrt7h51hr3l3
Tags: 0.8.8-1ubuntu1
* Resynchronize and merge from Debian unstable. Remaining changes:
  - debian/patches:
    * 9000-delayed_iff_up_bridge.patch
    * 9001-dont_clobber_existing_bridges.patch
    * 9002-better_default_uri_virsh.patch
    * 9003-better-default-arch.patch
    * 9004-libvirtd-group-name.patch
    * 9005-increase-unix-socket-timeout.patch
    * 9006-default-config-test-case.patch
    * 9007-fix-daemon-conf-ftbfs.patch
    * 9011-move-ebtables-script.patch
    * 9014-skip-nodeinfotest.patch
    * 9020-lp545795.patch
    * 9021-fix-uint64_t.patch
  - debian/patches/series:
    * Disable qemu-disable-network.diff.patch
  - debian/control:
    * set ubuntu maintainer
    * Build-Depends:
      - swap libxen to libxen3, qemu to qemu-kvm, and open-iscsi to
        open-iscsi-utils in Build-Depends
      - remove virtualbox Build-Depends
      - add libxml2 and libapparmor-dev Build-Depends
    * convert Vcs-Git to Xs-Debian-Vcs-Git
    * libvirt-bin Depends: move netcat-openbsd, bridge-utils, dnsmasq-base
      (>= 2.46-1), and iptables from Recommends to Depends
    * libvirt-bin Recommends: move qemu to Suggests
    * libvirt-bin Suggests: add apparmor
    * libvirt0 Recommands: move lvm2 to Suggests
  - keep debian/libvirt-bin.apport
  - keep debian/libvirt-bin.cron.daily
  - debian/libvirt-bin.dirs:
    * add apparmor, cron.daily, and apport dirs
  - debian/libvirt-bin.examples:
    * add debian/libvirt-suspendonreboot
  - debian/libvirt-bin.install:
    * add /etc/apparmor.d files
    * add apport hook
  - debian/libvirt-bin.manpages:
    * add debian/libvirt-migrate-qemu-disks.1
  - debian/libvirt-bin.postinst:
    * replace libvirt groupname with libvirtd
    * add each admin user to libvirtd group
    * call apparmor_parser on usr.sbin.libvirtd and
      usr.lib.libvirt.virt-aa-helper
    * call 'libvirt-migrate-qemu-disks -a' after
      libvirt-bin has started if migrating from
      older than 0.8.3-1ubuntu1
  - debian/libvirt-bin.postrm:
    * replace libvirt groupname with libvirtd
    * remove usr.sbin.libvirtd and
      usr.lib.libvirt.virt-aa-helper
  - keep added files under debian/:
    * libvirt-bin.upstart
    * libvirt-migrate-qemu-disks
    * libvirt-migrate-qemu-disks.1
    * libvirt-suspendonreboot
    * apparmor profiles
  - debian/README.Debian:
    * add 'Apparmor Profile' section
    * add 'Disk migration' section
  - debian/rules:
    * don't build with vbox since virtualbox-ose is in universe
    * add --with-apparmor to DEB_CONFIGURE_EXTRA_FLAGS
    * set DEB_DH_INSTALLINIT_ARGS to '--upstart-only'
    * set DEB_MAKE_CHECK_TARGET to 'check'
    * remove unneeded binary-install/libvirt-bin:: and clean::
      sections (they only deal with sysvinit stuff)
    * add build/libvirt-bin:: section to install
      - apparmor files
      - apport hooks
      - libvirt-migrate-qemu-disks
* The following Ubuntu packaging changes occurred during the divergence
  between Debian and Ubuntu. These changes are not new, but included here
  for completeness: (0.8.5-0ubuntu1 - 0.8.5-0ubuntu5):
  - Have upstart job source /etc/default/libvirt-bin.  This is only a
    temporary fix until upstart provides proper default override support
    through /etc/init/libvirt-bin.override (or any other mechanism).
    (LP: 708172)
  - debian/apparmor/usr.sbin.libvirtd: use PUx instead of Ux for executables
    (LP: 573315)
  - Rebuild with python 2.7 as the python default.
  - debian/libvirt-bin.cron.daily: use shell globbing to enumerate xml files.
    Based on patch thanks to Henryk Plötz (LP: 655176)
* Dropped the following patches included/fixed upstream:
  - 9010-dont-disable-ipv6.patch
  - 9022-build-cleanup-declaration-of-xen-tests.patch
  - 9023-vah-require-uuid.patch
  - 9009-autodetect-nc-params.patch
    * rolled into Debian's
      Autodetect-if-the-remote-nc-command-supports-the-q-o.patch
* Updated the following patches:
  - 9011-move-ebtables-script.patch:
    * LOCALSTATEDIR is defined in configmake.h
  - 9000-9006: added DEP-3 tags
  - 9002-better_default_uri_virsh.patch: updated (context changed)
* New patches:
  - 9022-drop-booton-when-kernel-specified.patch (LP: #720426)
  - 9023-fix-lxc-console-hangup.patch (LP: #668369)
  - 9024-skip-broken-commandtest.patch
* debian/patches/series:
  - don't apply Disable-CHECKSUM-rule.patch: our iptables can do this
  - don't apply Debian-specific Debianize-libvirt-guests.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
            </div>
35
35
          </li><li>
36
36
            <div>
 
37
              <a title="Applications known to use libvirt" class="inactive" href="apps.html">Applications</a>
 
38
            </div>
 
39
          </li><li>
 
40
            <div>
37
41
              <a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
38
42
            </div>
39
43
          </li><li>
41
45
              <a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
42
46
              <ul class="l1"><li>
43
47
                  <div>
 
48
                    <a title="How to compile libvirt" class="inactive" href="compiling.html">Compiling</a>
 
49
                  </div>
 
50
                </li><li>
 
51
                  <div>
44
52
                    <a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
45
53
                  </div>
46
54
                </li><li>
60
68
                        </div>
61
69
                      </li><li>
62
70
                        <div>
 
71
                          <a title="Network filter XML format" class="inactive" href="formatnwfilter.html">Network Filtering</a>
 
72
                        </div>
 
73
                      </li><li>
 
74
                        <div>
63
75
                          <a title="The storage pool and volume XML format" class="inactive" href="formatstorage.html">Storage</a>
64
76
                        </div>
65
77
                      </li><li>
104
116
                  <div>
105
117
                    <a title="A guide and reference for developing with libvirt" class="inactive" href="devguide.html">Development Guide</a>
106
118
                  </div>
 
119
                </li><li>
 
120
                  <div>
 
121
                    <a title="Command reference for virsh" class="inactive" href="virshcmdref.html">Virsh Commands</a>
 
122
                  </div>
107
123
                </li></ul>
108
124
            </div>
109
125
          </li><li>
148
164
                    <a href="#elementsOSKernel">Direct kernel boot</a>
149
165
                  </li></ul>
150
166
              </li><li>
 
167
                <a href="#elementsSysinfo">SMBIOS System Information</a>
 
168
              </li><li>
151
169
                <a href="#elementsResources">Basic resources</a>
152
170
              </li><li>
153
171
                <a href="#elementsCPU">CPU model and topology</a>
162
180
                <ul><li>
163
181
                    <a href="#elementsDisks">Hard drives, floppy disks, CDROMs</a>
164
182
                  </li><li>
 
183
                    <a href="#elementsControllers">Controllers</a>
 
184
                  </li><li>
165
185
                    <a href="#elementsUSB">USB and PCI devices</a>
166
186
                  </li><li>
 
187
                    <a href="#elementsSmartcard">Smartcard devices</a>
 
188
                  </li><li>
167
189
                    <a href="#elementsNICS">Network interfaces</a>
168
190
                    <ul><li>
169
191
                        <a href="#elementsNICSVirtual">Virtual network</a>
183
205
                        <a href="#elementsNICSModel">Setting the NIC model</a>
184
206
                      </li><li>
185
207
                        <a href="#elementsNICSTargetOverride">Overriding the target element</a>
 
208
                      </li><li>
 
209
                        <a href="#elementsNICSBoot">Specifying boot order</a>
186
210
                      </li></ul>
187
211
                  </li><li>
188
212
                    <a href="#elementsInput">Input devices</a>
275
299
        a globally unique identifier for the virtual machine.
276
300
        The format must be RFC 4122 compliant, eg <code>3e3fce45-4f53-4fa7-bb32-11f34168b82b</code>.
277
301
        If omitted when defining/creating a new machine, a random
278
 
        UUID is generated. <span class="since">Since 0.0.1</span></dd><dt><code>description</code></dt><dd>The content of the <code>description</code> element provides a
 
302
        UUID is generated. It is also possible to provide the UUID
 
303
        via a <a href="#elementsSysinfo"><code>sysinfo</code></a>
 
304
        specification. <span class="since">Since 0.0.1, sysinfo
 
305
        since 0.8.7</span></dd><dt><code>description</code></dt><dd>The content of the <code>description</code> element provides a
279
306
      human readable description of the virtual machine. This data is not
280
307
      used by libvirt in any way, it can contain any information the user
281
308
      wants. <span class="since">Since 0.7.2</span></dd></dl>
303
330
    &lt;boot dev='hd'/&gt;
304
331
    &lt;boot dev='cdrom'/&gt;
305
332
    &lt;bootmenu enable='yes'/&gt;
 
333
    &lt;smbios mode='sysinfo'/&gt;
306
334
  &lt;/os&gt;
307
335
  ...</pre>
308
336
        <dl><dt><code>type</code></dt><dd>The content of the <code>type</code> element specifies the
318
346
        only needed by Xen fully virtualized domains. <span class="since">Since 0.1.0</span></dd><dt><code>boot</code></dt><dd>The <code>dev</code> attribute takes one of the values "fd", "hd",
319
347
        "cdrom" or "network" and is used to specify the next boot device
320
348
        to consider. The <code>boot</code> element can be repeated multiple
321
 
        times to setup a priority list of boot devices to try in turn.
322
 
        <span class="since">Since 0.1.3</span>
 
349
        times to setup a priority list of boot devices to try in turn. The
 
350
        <code>boot</code> element cannot be used if per-device boot elements
 
351
        are used (see <a href="#elementsDisks">disks</a>,
 
352
        <a href="#elementsNICS">network interfaces</a>, and
 
353
        <a href="#elementsUSB">USB and PCI devices</a> sections below).
 
354
        <span class="since">Since 0.1.3, per-device boot since 0.8.8</span>
323
355
      </dd><dt><code>bootmenu</code></dt><dd> Whether or not to enable an interactive boot menu prompt on guest
324
356
      startup. The <code>enable</code> attribute can be either "yes" or "no".
325
357
      If not specified, the hypervisor default is used. <span class="since">
326
358
      Since 0.8.3</span>
 
359
      </dd><dt><code>smbios</code></dt><dd>How to populate SMBIOS information visible in the guest.
 
360
      The <code>mode</code> attribute must be specified, and is either
 
361
      "emulate" (let the hypervisor generate all values), "host" (copy
 
362
      all of Block 0 and Block 1, except for the UUID, from the host's
 
363
      SMBIOS values;
 
364
      the <a href="html/libvirt-libvirt.html#virConnectGetSysinfo">
 
365
      <code>virConnectGetSysinfo</code></a> call can be
 
366
      used to see what values are copied), or "sysinfo" (use the values in
 
367
      the <a href="#elementsSysinfo">sysinfo</a> element).  If not
 
368
      specified, the hypervisor default is used. <span class="since">
 
369
      Since 0.8.7</span>
327
370
      </dd></dl>
328
371
        <h4>
329
372
          <a name="elementsOSBootloader" id="elementsOSBootloader">Host bootloader</a>
376
419
        specify an alternate primary console (eg serial port), or the
377
420
        installation media source / kickstart file</dd></dl>
378
421
        <h3>
 
422
          <a name="elementsSysinfo" id="elementsSysinfo">SMBIOS System Information</a>
 
423
        </h3>
 
424
        <p>
 
425
      Some hypervisors allow control over what system information is
 
426
      presented to the guest (for example, SMBIOS fields can be
 
427
      populated by a hypervisor and inspected via
 
428
      the <code>dmidecode</code> command in the guest).  The
 
429
      optional <code>sysinfo</code> element covers all such categories
 
430
      of information. <span class="since">Since 0.8.7</span>
 
431
    </p>
 
432
        <pre>
 
433
  ...
 
434
  &lt;os&gt;
 
435
    &lt;smbios mode='sysinfo'/&gt;
 
436
    ...
 
437
  &lt;/os&gt;
 
438
  &lt;sysinfo type='smbios'&gt;
 
439
    &lt;bios&gt;
 
440
      &lt;entry name='vendor'&gt;LENOVO&lt;/entry&gt;
 
441
    &lt;/bios&gt;
 
442
    &lt;system&gt;
 
443
      &lt;entry name='manufacturer'&gt;Fedora&lt;/entry&gt;
 
444
      &lt;entry name='vendor'&gt;Virt-Manager&lt;/entry&gt;
 
445
    &lt;/system&gt;
 
446
  &lt;/sysinfo&gt;
 
447
  ...</pre>
 
448
        <p>
 
449
      The <code>sysinfo</code> element has a mandatory
 
450
      attribute <code>type</code> that determine the layout of
 
451
      sub-elements, with supported values of:
 
452
    </p>
 
453
        <dl><dt><code>smbios</code></dt><dd>Sub-elements call out specific SMBIOS values, which will
 
454
      affect the guest if used in conjunction with
 
455
      the <code>smbios</code> sub-element of
 
456
      the <a href="#elementsOS"><code>os</code></a> element.  Each
 
457
      sub-element of <code>sysinfo</code> names a SMBIOS block, and
 
458
      within those elements can be a list of <code>entry</code>
 
459
      elements that describe a field within the block.  The following
 
460
      blocks and entries are recognized:
 
461
        <dl><dt><code>bios</code></dt><dd>
 
462
            This is block 0 of SMBIOS, with entry names drawn from
 
463
            "vendor", "version", "date", and "release".
 
464
          </dd><dt><code>system</code></dt><dd>
 
465
            This is block 1 of SMBIOS, with entry names drawn from
 
466
            "manufacturer", "product", "version", "serial", "uuid",
 
467
            "sku", and "family".  If a "uuid" entry is provided
 
468
            alongside a
 
469
            top-level <a href="#elementsMetadata"><code>uuid</code>
 
470
            element</a>, the two values must match.
 
471
          </dd></dl></dd></dl>
 
472
        <h3>
379
473
          <a name="elementsResources" id="elementsResources">Basic resources</a>
380
474
        </h3>
381
475
        <pre>
385
479
  &lt;memoryBacking&gt;
386
480
    &lt;hugepages/&gt;
387
481
  &lt;/memoryBacking&gt;
 
482
  &lt;blkiotune&gt;
 
483
    &lt;weight&gt;800&lt;/weight&gt;
 
484
  &lt;/blkiotune&gt;
388
485
  &lt;memtune&gt;
389
486
    &lt;hard_limit&gt;1048576&lt;/hard_limit&gt;
390
487
    &lt;soft_limit&gt;131072&lt;/soft_limit&gt;
394
491
  &lt;vcpu cpuset="1-4,^3,6" current="1"&gt;2&lt;/vcpu&gt;
395
492
  ...</pre>
396
493
        <dl><dt><code>memory</code></dt><dd>The maximum allocation of memory for the guest at boot time.
397
 
        The units for this value are kilobytes (i.e. blocks of 1024 bytes)</dd><dt><code>currentMemory</code></dt><dd>The actual allocation of memory for the guest. This value
 
494
        The units for this value are kilobytes (i.e. blocks of 1024 bytes)</dd><dt><code>currentMemory</code></dt><dd>The actual allocation of memory for the guest. This value can
398
495
        be less than the maximum allocation, to allow for ballooning
399
496
        up the guests memory on the fly. If this is omitted, it defaults
400
 
        to the same value as the <code>memory<code> element</code></code></dd><dt><code>memoryBacking</code></dt><dd>The optional <code>memoryBacking</code> element, may have an
 
497
        to the same value as the <code>memory</code> element</dd><dt><code>memoryBacking</code></dt><dd>The optional <code>memoryBacking</code> element, may have an
401
498
        <code>hugepages</code> element set within it. This tells the
402
499
        hypervisor that the guest should have its memory allocated using
403
 
        hugepages instead of the normal native page size.</dd><dt><code>memtune</code></dt><dd> The optional <code>memtune</code> element provides details
404
 
      regarding the memory tuneable parameters for the domain. If this is
405
 
      omitted, it defaults to the OS provided defaults.</dd><dt><code>hard_limit</code></dt><dd> The optional <code>hard_limit</code> element is the maximum memory
406
 
        the guest can use. The units for this value are kilobytes (i.e. blocks
407
 
        of 1024 bytes)</dd><dt><code>soft_limit</code></dt><dd> The optional <code>soft_limit</code> element is the memory limit to
408
 
        enforce during memory contention. The units for this value are
409
 
        kilobytes (i.e. blocks of 1024 bytes)</dd><dt><code>swap_hard_limit</code></dt><dd> The optional <code>swap_hard_limit</code> element is the maximum
410
 
        swap the guest can use. The units for this value are kilobytes
411
 
        (i.e. blocks of 1024 bytes)</dd><dt><code>min_guarantee</code></dt><dd> The optional <code>min_guarantee</code> element is the guaranteed
412
 
        minimum memory allocation for the guest. The units for this value are
413
 
        kilobytes (i.e. blocks of 1024 bytes)</dd><dt><code>vcpu</code></dt><dd>The content of this element defines the maximum number of virtual
 
500
        hugepages instead of the normal native page size.</dd><dt><code>blkiotune</code></dt><dd> The optional <code>blkiotune</code> element provides the ability
 
501
        to tune Blkio cgroup tunable parameters for the domain. If this is
 
502
        omitted, it defaults to the OS provided defaults.</dd><dt><code>weight</code></dt><dd> The optional <code>weight</code> element is the I/O weight of the
 
503
        guest. The value should be in range [100, 1000].</dd><dt><code>memtune</code></dt><dd> The optional <code>memtune</code> element provides details
 
504
        regarding the memory tunable parameters for the domain. If this is
 
505
        omitted, it defaults to the OS provided defaults.</dd><dt><code>hard_limit</code></dt><dd> The optional <code>hard_limit</code> element is the maximum memory
 
506
        the guest can use. The units for this value are kilobytes (i.e. blocks
 
507
        of 1024 bytes)</dd><dt><code>soft_limit</code></dt><dd> The optional <code>soft_limit</code> element is the memory limit to
 
508
        enforce during memory contention. The units for this value are
 
509
        kilobytes (i.e. blocks of 1024 bytes)</dd><dt><code>swap_hard_limit</code></dt><dd> The optional <code>swap_hard_limit</code> element is the maximum
 
510
        swap the guest can use. The units for this value are kilobytes
 
511
        (i.e. blocks of 1024 bytes)</dd><dt><code>min_guarantee</code></dt><dd> The optional <code>min_guarantee</code> element is the guaranteed
 
512
        minimum memory allocation for the guest. The units for this value are
 
513
        kilobytes (i.e. blocks of 1024 bytes)</dd><dt><code>vcpu</code></dt><dd>The content of this element defines the maximum number of virtual
414
514
        CPUs allocated for the guest OS, which must be between 1 and
415
515
        the maximum supported by the hypervisor.  <span class="since">Since
416
516
        0.4.4</span>, this element can contain an optional
463
563
            requested CPU.</dd><dt><code>exact</code></dt><dd>The virtual CPU provided to the guest will exactly match the
464
564
            specification</dd><dt><code>strict</code></dt><dd>The guest will not be created unless the host CPU does exactly
465
565
            match the specification.</dd></dl><span class="since">Since 0.8.5</span> the <code>match</code>
466
 
        attribute can be omitted and will default to <code>exact</code>.
 
566
        attribute can be omitted and will default to <code>exact</code>.
467
567
      </dd><dt><code>model</code></dt><dd>The content of the <code>model</code> element specifies CPU model
468
568
        requested by the guest. The list of available CPU models and their
469
569
        definition can be found in <code>cpu_map.xml</code> file installed
487
587
            CPU.</dd><dt><code>optional</code></dt><dd>The feature will be supported by virtual CPU if and only if it
488
588
            is supported by host CPU.</dd><dt><code>disable</code></dt><dd>The feature will not be supported by virtual CPU.</dd><dt><code>forbid</code></dt><dd>Guest creation will fail if the feature is supported by host
489
589
            CPU.</dd></dl><span class="since">Since 0.8.5</span> the <code>policy</code>
490
 
        attribute can be omitted and will default to <code>require</code>.
 
590
        attribute can be omitted and will default to <code>require</code>.
491
591
      </dd></dl>
492
592
        <h3>
493
593
          <a name="elementsLifecycle" id="elementsLifecycle">Lifecycle control</a>
539
639
    &lt;pae/&gt;
540
640
    &lt;acpi/&gt;
541
641
    &lt;apic/&gt;
 
642
    &lt;hap/&gt;
542
643
  &lt;/features&gt;
543
644
  ...</pre>
544
645
        <p>
551
652
        <dl><dt><code>pae</code></dt><dd>Physical address extension mode allows 32-bit guests
552
653
        to address more than 4 GB of memory.</dd><dt><code>acpi</code></dt><dd>ACPI is useful for power management, for example, with
553
654
        KVM guests it is required for graceful shutdown to work.
 
655
      </dd><dt><code>hap</code></dt><dd>Enable use of Hardware Assisted Paging if available in
 
656
        the hardware.
554
657
      </dd></dl>
555
658
        <h3>
556
659
          <a name="elementsTime" id="elementsTime">Time keeping</a>
571
674
  &lt;/clock&gt;
572
675
  ...</pre>
573
676
        <dl><dt><code>clock</code></dt><dd>
574
 
        <p>The <code>offset</code> attribute takes four possible
575
 
          values, allowing fine grained control over how the guest
576
 
          clock is synchronized to the host. NB, not all hypervisors
577
 
          support all modes.</p>
578
 
        <dl><dt><code>utc</code></dt><dd>
579
 
            The guest clock will always be synchronized to UTC when
580
 
            booted</dd><dt><code>localtime</code></dt><dd>
581
 
            The guest clock will be synchronized to the host's configured
582
 
            timezone when booted, if any.
583
 
          </dd><dt><code>timezone</code></dt><dd>
584
 
            The guest clock will be synchronized to the requested timezone
585
 
            using the <code>timezone</code> attribute.
586
 
            <span class="since">Since 0.7.7</span>
587
 
          </dd><dt><code>variable</code></dt><dd>
588
 
            The guest clock will have an arbitrary offset applied
589
 
            relative to UTC. The delta relative to UTC is specified
590
 
            in seconds, using the <code>adjustment</code> attribute.
591
 
            The guest is free to adjust the RTC over time an expect
592
 
            that it will be honoured at next reboot. This is in
593
 
            contrast to 'utc' mode, where the RTC adjustments are
594
 
            lost at each reboot. <span class="since">Since 0.7.7</span>
595
 
          </dd></dl><p>
596
 
          A <code>clock</code> may have zero or more
597
 
          <code>timer</code>sub-elements. <span class="since">Since
598
 
          0.8.0</span>
599
 
        </p>
 
677
        <p>The <code>offset</code> attribute takes four possible
 
678
          values, allowing fine grained control over how the guest
 
679
          clock is synchronized to the host. NB, not all hypervisors
 
680
          support all modes.</p>
 
681
        <dl><dt><code>utc</code></dt><dd>
 
682
            The guest clock will always be synchronized to UTC when
 
683
            booted</dd><dt><code>localtime</code></dt><dd>
 
684
            The guest clock will be synchronized to the host's configured
 
685
            timezone when booted, if any.
 
686
          </dd><dt><code>timezone</code></dt><dd>
 
687
            The guest clock will be synchronized to the requested timezone
 
688
            using the <code>timezone</code> attribute.
 
689
            <span class="since">Since 0.7.7</span>
 
690
          </dd><dt><code>variable</code></dt><dd>
 
691
            The guest clock will have an arbitrary offset applied
 
692
            relative to UTC. The delta relative to UTC is specified
 
693
            in seconds, using the <code>adjustment</code> attribute.
 
694
            The guest is free to adjust the RTC over time an expect
 
695
            that it will be honoured at next reboot. This is in
 
696
            contrast to 'utc' mode, where the RTC adjustments are
 
697
            lost at each reboot. <span class="since">Since 0.7.7</span>
 
698
          </dd></dl><p>
 
699
          A <code>clock</code> may have zero or more
 
700
          <code>timer</code>sub-elements. <span class="since">Since
 
701
          0.8.0</span>
 
702
        </p>
600
703
      </dd><dt><code>timer</code></dt><dd>
601
 
        <p>
602
 
          Each timer element requires a <code>name</code> attribute,
603
 
          and has other optional attributes that depend on
604
 
          the <code>name</code> specified.  Various hypervisors
605
 
          support different combinations of attributes.
606
 
        </p>
607
 
        <dl><dt><code>name</code></dt><dd>
608
 
            The <code>name</code> attribute selects which timer is
609
 
            being modified, and can be one of "platform", "pit",
610
 
            "rtc", "hpet", or "tsc".
611
 
          </dd><dt><code>track</code></dt><dd>
612
 
            The <code>track</code> attribute specifies what the timer
613
 
            tracks, and can be "boot", "guest", or "wall".
614
 
            Only valid for <code>name="rtc"</code>
615
 
            or <code>name="platform"</code>.
616
 
          </dd><dt><code>tickpolicy</code></dt><dd>
617
 
            The <code>tickpolicy</code> attribute determines how
618
 
            missed ticks in the guest are handled, and can be "delay",
619
 
            "catchup", "merge", or "discard".  If the policy is
620
 
            "catchup", there can be further details in
621
 
            the <code>catchup</code> sub-element.
622
 
            <dl><dt><code>catchup</code></dt><dd>
623
 
                The <code>catchup</code> element has three optional
624
 
                attributes, each a positive integer.  The attributes
625
 
                are <code>threshold</code>, <code>slew</code>,
626
 
                and <code>limit</code>.
627
 
              </dd></dl></dd><dt><code>frequency</code></dt><dd>
628
 
            The <code>frequency</code> attribute is an unsigned
629
 
            integer specifying the frequency at
630
 
            which <code>name="tsc"</code> runs.
631
 
          </dd><dt><code>mode</code></dt><dd>
632
 
            The <code>mode</code> attribute controls how
633
 
            the <code>name="tsc"</code> timer is managed, and can be
634
 
            "auto", "native", "emulate", "paravirt", or "smpsafe".
635
 
            Other timers are always emulated.
636
 
          </dd><dt><code>present</code></dt><dd>
637
 
            The <code>present</code> attribute can be "yes" or "no" to
638
 
            specify whether a particular timer is available to the guest.
639
 
          </dd></dl></dd></dl>
 
704
        <p>
 
705
          Each timer element requires a <code>name</code> attribute,
 
706
          and has other optional attributes that depend on
 
707
          the <code>name</code> specified.  Various hypervisors
 
708
          support different combinations of attributes.
 
709
        </p>
 
710
        <dl><dt><code>name</code></dt><dd>
 
711
            The <code>name</code> attribute selects which timer is
 
712
            being modified, and can be one of "platform", "pit",
 
713
            "rtc", "hpet", or "tsc".
 
714
          </dd><dt><code>track</code></dt><dd>
 
715
            The <code>track</code> attribute specifies what the timer
 
716
            tracks, and can be "boot", "guest", or "wall".
 
717
            Only valid for <code>name="rtc"</code>
 
718
            or <code>name="platform"</code>.
 
719
          </dd><dt><code>tickpolicy</code></dt><dd>
 
720
            The <code>tickpolicy</code> attribute determines how
 
721
            missed ticks in the guest are handled, and can be "delay",
 
722
            "catchup", "merge", or "discard".  If the policy is
 
723
            "catchup", there can be further details in
 
724
            the <code>catchup</code> sub-element.
 
725
            <dl><dt><code>catchup</code></dt><dd>
 
726
                The <code>catchup</code> element has three optional
 
727
                attributes, each a positive integer.  The attributes
 
728
                are <code>threshold</code>, <code>slew</code>,
 
729
                and <code>limit</code>.
 
730
              </dd></dl></dd><dt><code>frequency</code></dt><dd>
 
731
            The <code>frequency</code> attribute is an unsigned
 
732
            integer specifying the frequency at
 
733
            which <code>name="tsc"</code> runs.
 
734
          </dd><dt><code>mode</code></dt><dd>
 
735
            The <code>mode</code> attribute controls how
 
736
            the <code>name="tsc"</code> timer is managed, and can be
 
737
            "auto", "native", "emulate", "paravirt", or "smpsafe".
 
738
            Other timers are always emulated.
 
739
          </dd><dt><code>present</code></dt><dd>
 
740
            The <code>present</code> attribute can be "yes" or "no" to
 
741
            specify whether a particular timer is available to the guest.
 
742
          </dd></dl></dd></dl>
640
743
        <h3>
641
744
          <a name="elementsDevices" id="elementsDevices">Devices</a>
642
745
        </h3>
674
777
      &lt;driver name="tap" type="aio" cache="default"/&gt;
675
778
      &lt;source file='/var/lib/xen/images/fv0'/&gt;
676
779
      &lt;target dev='hda' bus='ide'/&gt;
 
780
      &lt;boot order='2'/&gt;
677
781
      &lt;encryption type='...'&gt;
678
782
        ...
679
783
      &lt;/encryption&gt;
682
786
        ...
683
787
      &lt;/serial&gt;
684
788
    &lt;/disk&gt;
 
789
      ...
 
790
    &lt;disk type='network'&gt;
 
791
      &lt;driver name="qemu" type="raw" io="threads"/&gt;
 
792
      &lt;source protocol="sheepdog" name="image_name"&gt;
 
793
        &lt;host name="hostname" port="7000"/&gt;
 
794
      &lt;/source&gt;
 
795
      &lt;target dev="hdb" bus="ide"/&gt;
 
796
      &lt;boot order='1'/&gt;
 
797
      &lt;address type='drive' controller='0' bus='1' unit='0'/&gt;
 
798
    &lt;/disk&gt;
685
799
  &lt;/devices&gt;
686
800
  ...</pre>
687
801
        <dl><dt><code>disk</code></dt><dd>The <code>disk</code> element is the main container for describing
688
 
        disks. The <code>type</code> attribute is either "file" or "block"
 
802
        disks. The <code>type</code> attribute is either "file",
 
803
        "block", "dir", or "network"
689
804
        and refers to the underlying source for the disk. The optional
690
805
        <code>device</code> attribute indicates how the disk is to be exposed
691
806
        to the guest OS. Possible values for this attribute are "floppy", "disk"
692
807
        and "cdrom", defaulting to "disk".
693
 
        <span class="since">Since 0.0.3; "device" attribute since 0.1.4</span></dd><dt><code>source</code></dt><dd>If the disk <code>type</code> is "file", then the <code>file</code> attribute
694
 
        specifies the fully-qualified path to the file holding the disk. If the disk
695
 
        <code>type</code> is "block", then the <code>dev</code> attribute specifies
696
 
        the path to the host device to serve as the disk. <span class="since">Since 0.0.3</span></dd><dt><code>target</code></dt><dd>The <code>target</code> element controls the bus / device under which the
 
808
        <span class="since">Since 0.0.3; "device" attribute since 0.1.4;
 
809
        "network" attribute since 0.8.7</span></dd><dt><code>source</code></dt><dd>If the disk <code>type</code> is "file", then the
 
810
        the <code>file</code> attribute specifies the fully-qualified
 
811
        path to the file holding the disk. If the disk
 
812
        <code>type</code> is "block", then the <code>dev</code>
 
813
        attribute specifies the path to the host device to serve as
 
814
        the disk. If the disk <code>type</code> is "network", then
 
815
        the <code>protocol</code> attribute specifies the protocol to
 
816
        access to the requested image; possible values are "nbd",
 
817
        "rbd", and "sheepdog".  If the <code>protocol</code> attribute
 
818
        is "rbd" or "sheepdog", an additional
 
819
        attribute <code>name</code> is mandatory to specify which
 
820
        image to be used.  When the disk <code>type</code> is
 
821
        "network", the <code>source</code> may have zero or
 
822
        more <code>host</code> sub-elements used to specify the hosts
 
823
        to connect.
 
824
        <span class="since">Since 0.0.3</span></dd><dt><code>target</code></dt><dd>The <code>target</code> element controls the bus / device under which the
697
825
        disk is exposed to the guest OS. The <code>dev</code> attribute indicates
698
826
        the "logical" device name. The actual device name specified is not guaranteed to map to
699
827
        the device name in the guest OS. Treat it as a device ordering hint.
703
831
        inferred from the style of the device name. eg, a device named 'sda'
704
832
        will typically be exported using a SCSI bus.
705
833
        <span class="since">Since 0.0.3; <code>bus</code> attribute since 0.4.3;
706
 
        "usb" attribute value since after 0.4.4</span></dd><dt><code>driver</code></dt><dd>If the hypervisor supports multiple backend drivers, then the optional
707
 
        <code>driver</code> element allows them to be selected. The <code>name</code>
708
 
        attribute is the primary backend driver name, while the optional <code>type</code>
709
 
        attribute provides the sub-type. The optional <code>cache</code> attribute
710
 
        controls the cache mechanism, possible values are "default", "none",
711
 
        "writethrough" and "writeback". <span class="since">Since 0.1.8</span>
 
834
        "usb" attribute value since after 0.4.4</span></dd><dt><code>driver</code></dt><dd>
 
835
        The optional driver element allows specifying further details
 
836
        related to the hypervisor driver used to provide the disk.
 
837
        <span class="since">Since 0.1.8; <code>io</code> attribute
 
838
        since 0.8.8</span>
 
839
        <ul><li>
 
840
            If the hypervisor supports multiple backend drivers, then
 
841
            the <code>name</code> attribute selects the primary
 
842
            backend driver name, while the optional <code>type</code>
 
843
            attribute provides the sub-type.  For example, xen
 
844
            supports a name of "tap", "tap2", "phy", or "file", with a
 
845
            type of "aio", while qemu only supports a name of "qemu",
 
846
            but multiple types including "raw", "bochs", "qcow2", and
 
847
            "qed".
 
848
          </li><li>
 
849
            The optional <code>cache</code> attribute controls the
 
850
            cache mechanism, possible values are "default", "none",
 
851
            "writethrough" and "writeback".
 
852
          </li><li>
 
853
            The optional <code>error_policy</code> attribute controls
 
854
            how the hypervisor will behave on an error, possible
 
855
            values are "stop", "ignore", and "enospace".
 
856
          </li><li>
 
857
            The optional <code>io</code> attribute controls specific
 
858
            policies on I/O; qemu guests support "threads" and
 
859
            "native".
 
860
          </li></ul></dd><dt><code>boot</code></dt><dd>Specifies that the disk is bootable. The <code>order</code>
 
861
        attribute determines the order in which devices will be tried during
 
862
        boot sequence. The per-device <code>boot</code> elements cannot be
 
863
        used together with general boot elements in
 
864
        <a href="#elementsOSBIOS">BIOS bootloader</a> section.
 
865
        <span class="since">Since 0.8.8</span>
712
866
      </dd><dt><code>encryption</code></dt><dd>If present, specifies how the volume is encrypted.  See
713
867
        the <a href="formatstorageencryption.html">Storage Encryption</a> page
714
868
        for more information.
718
872
      </dd><dt><code>serial</code></dt><dd>If present, this specify serial number of virtual hard drive.
719
873
          For example, it may look as <code>&lt;serial&gt;WD-WMAP9A966149&lt;/serial&gt;</code>.
720
874
          <span class="since">Since 0.7.1</span>
 
875
      </dd><dt><code>host</code></dt><dd>The <code>host</code> element has two attributes "name" and "port",
 
876
        which specify the hostname and the port number. The meaning of this
 
877
        element and the number of the elements depend on the protocol attribute.
 
878
        <table class="top_table"><tr><th> Protocol </th><th> Meaning </th><th> Number of hosts </th></tr><tr><td> nbd </td><td> a server running nbd-server </td><td> only one </td></tr><tr><td> rbd </td><td> monitor servers of RBD </td><td> one or more </td></tr><tr><td> sheepdog </td><td> one of the sheepdog servers (default is localhost:7000) </td><td> zero or one </td></tr></table></dd><dt><code>address</code></dt><dd>If present, the <code>address</code> element ties the disk
 
879
        to a given slot of a controller (the
 
880
        actual <code>&lt;controller&gt;</code> device can often be
 
881
        inferred by libvirt, although it can
 
882
        be <a href="#elementsControllers">explicitly specified</a>).
 
883
        The <code>type</code> attribute is mandatory, and is typically
 
884
        "pci" or "drive".  For a "pci" controller, additional
 
885
        attributes for <code>bus</code>, <code>slot</code>,
 
886
        and <code>function</code> must be present, as well as an
 
887
        optional <code>domain</code>.  For a "drive" controller,
 
888
        additional attributes <code>controller</code>, <code>bus</code>,
 
889
        and <code>unit</code> are available, each defaulting to 0.
721
890
      </dd></dl>
722
891
        <h4>
 
892
          <a name="elementsControllers" id="elementsControllers">Controllers</a>
 
893
        </h4>
 
894
        <p>
 
895
      Many devices that have an <code>&lt;address&gt;</code>
 
896
      sub-element are designed to work with a controller to manage
 
897
      related devices.  Normally, libvirt can automatically infer such
 
898
      controllers without requiring explicit XML markup, but sometimes
 
899
      it is necessary to provide an explicit controller element.
 
900
    </p>
 
901
        <pre>
 
902
  ...
 
903
  &lt;devices&gt;
 
904
    &lt;controller type='ide' index='0'/&gt;
 
905
    &lt;controller type='virtio-serial' index='0' ports='16' vectors='4'/&gt;
 
906
    &lt;controller type='virtio-serial' index='1'&gt;
 
907
      &lt;address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/&gt;
 
908
    &lt;/controller&gt;
 
909
    ...
 
910
  &lt;/devices&gt;
 
911
  ...</pre>
 
912
        <p>
 
913
      Each controller has a mandatory attribute <code>type</code>,
 
914
      which must be one of "ide", "fdc", "scsi", "sata", "ccid", or
 
915
      "virtio-serial", and a mandatory attribute <code>index</code>
 
916
      which is the decimal integer describing in which order the bus
 
917
      controller is encountered (for use in <code>controller</code>
 
918
      attributes of <code>&lt;address&gt;</code> elements).  The
 
919
      "virtio-serial" controller has two additional optional
 
920
      attributes <code>ports</code> and <code>vectors</code>, which
 
921
      control how many devices can be connected through the
 
922
      controller.  A "scsi" controller has an optional
 
923
      attribute <code>model</code>, which is one of "auto",
 
924
      "buslogic", "lsilogic", "lsias1068", or "vmpvscsi".
 
925
    </p>
 
926
        <p>
 
927
      For controllers that are themselves devices on a PCI or USB bus,
 
928
      an optional sub-element <code>&lt;address&gt;</code> can specify
 
929
      the exact relationship of the controller to its master bus, with
 
930
      semantics like any other device's <code>address</code>
 
931
      sub-element.
 
932
    </p>
 
933
        <h4>
723
934
          <a name="elementsUSB" id="elementsUSB">USB and PCI devices</a>
724
935
        </h4>
725
936
        <p>
735
946
        &lt;vendor id='0x1234'/&gt;
736
947
        &lt;product id='0xbeef'/&gt;
737
948
      &lt;/source&gt;
 
949
      &lt;boot order='2'/&gt;
738
950
    &lt;/hostdev&gt;
739
951
  &lt;/devices&gt;
740
952
  ...</pre>
746
958
      &lt;source&gt;
747
959
        &lt;address bus='0x06' slot='0x02' function='0x0'/&gt;
748
960
      &lt;/source&gt;
 
961
      &lt;boot order='1'/&gt;
749
962
    &lt;/hostdev&gt;
750
963
  &lt;/devices&gt;
751
964
  ...</pre>
761
974
      <code>address</code></dd><dt><code>vendor</code>, <code>product</code></dt><dd>The <code>vendor</code> and <code>product</code> elements each have an
762
975
      <code>id</code> attribute that specifies the USB vendor and product id.
763
976
      The ids can be given in decimal, hexadecimal (starting with 0x) or
764
 
      octal (starting with 0) form.</dd><dt><code>address</code></dt><dd>The <code>address</code> element for USB devices has a
 
977
      octal (starting with 0) form.</dd><dt><code>boot</code></dt><dd>Specifies that the device is bootable. The <code>order</code>
 
978
      attribute determines the order in which devices will be tried during
 
979
      boot sequence. The per-device <code>boot</code> elements cannot be
 
980
      used together with general boot elements in
 
981
      <a href="#elementsOSBIOS">BIOS bootloader</a> section.
 
982
      <span class="since">Since 0.8.8</span></dd><dt><code>address</code></dt><dd>The <code>address</code> element for USB devices has a
765
983
      <code>bus</code> and <code>device</code> attribute to specify the
766
984
      USB bus and device number the device appears at on the host.
767
985
      The values of these attributes can be given in decimal, hexadecimal
776
994
      PCI domain, with hexadecimal values 0 to ffff, but it is currently
777
995
      not used by qemu.</dd></dl>
778
996
        <h4>
 
997
          <a name="elementsSmartcard" id="elementsSmartcard">Smartcard devices</a>
 
998
        </h4>
 
999
        <p>
 
1000
      A virtual smartcard device can be supplied to the guest via the
 
1001
      <code>smartcard</code> element. A USB smartcard reader device on
 
1002
      the host cannot be used on a guest with simple device
 
1003
      passthrough, since it will then not be available on the host,
 
1004
      possibly locking the host computer when it is "removed".
 
1005
      Therefore, some hypervisors provide a specialized virtual device
 
1006
      that can present a smartcard interface to the guest, with
 
1007
      several modes for describing how credentials are obtained from
 
1008
      the host or even a from a channel created to a third-party
 
1009
      smartcard provider. <span class="since">Since 0.8.8</span>
 
1010
    </p>
 
1011
        <pre>
 
1012
  ...
 
1013
  &lt;devices&gt;
 
1014
    &lt;smartcard mode='host'/&gt;
 
1015
    &lt;smartcard mode='host-certificates'&gt;
 
1016
      &lt;certificate&gt;cert1&lt;/certificate&gt;
 
1017
      &lt;certificate&gt;cert2&lt;/certificate&gt;
 
1018
      &lt;certificate&gt;cert3&lt;/certificate&gt;
 
1019
      &lt;database&gt;/etc/pki/nssdb/&lt;/database&gt;
 
1020
    &lt;/smartcard&gt;
 
1021
    &lt;smartcard mode='passthrough' type='tcp'&gt;
 
1022
      &lt;source mode='bind' host='127.0.0.1' service='2001'/&gt;
 
1023
      &lt;protocol type='raw'/&gt;
 
1024
      &lt;address type='ccid' controller='0' slot='0'/&gt;
 
1025
    &lt;/smartcard&gt;
 
1026
    &lt;smartcard mode='passthrough' type='spicevmc'/&gt;
 
1027
  &lt;/devices&gt;
 
1028
  ...
 
1029
</pre>
 
1030
        <p>
 
1031
      The <code>&lt;smartcard&gt;</code> element has a mandatory
 
1032
      attribute <code>mode</code>.  The following modes are supported;
 
1033
      in each mode, the guest sees a device on its USB bus that
 
1034
      behaves like a physical USB CCID (Chip/Smart Card Interface
 
1035
      Device) card.
 
1036
    </p>
 
1037
        <dl><dt><code>mode='host'</code></dt><dd>The simplest operation, where the hypervisor relays all
 
1038
      requests from the guest into direct access to the host's
 
1039
      smartcard via NSS.  No other attributes or sub-elements are
 
1040
      required.  See below about the use of an
 
1041
      optional <code>&lt;address&gt;</code> sub-element.</dd><dt><code>mode='host-certificates'</code></dt><dd>Rather than requiring a smartcard to be plugged into the
 
1042
      host, it is possible to provide three NSS certificate names
 
1043
      residing in a database on the host.  These certificates can be
 
1044
      generated via the command <code>certutil -d /etc/pki/nssdb -x -t
 
1045
      CT,CT,CT -S -s CN=cert1 -n cert1</code>, and the resulting three
 
1046
      certificate names must be supplied as the content of each of
 
1047
      three <code>&lt;certificate&gt;</code> sub-elements.  An
 
1048
      additional sub-element <code>&lt;database&gt;</code> can specify
 
1049
      the absolute path to an alternate directory (matching
 
1050
      the <code>-d</code> option of the <code>certutil</code> command
 
1051
      when creating the certificates); if not present, it defaults to
 
1052
      /etc/pki/nssdb.</dd><dt><code>mode='passthrough'</code></dt><dd>Rather than having the hypervisor directly communicate with
 
1053
      the host, it is possible to tunnel all requests through a
 
1054
      secondary character device to a third-party provider (which may
 
1055
      in turn be talking to a smartcard or using three certificate
 
1056
      files).  In this mode of operation, an additional
 
1057
      attribute <code>type</code> is required, matching one of the
 
1058
      supported <a href="#elementsConsole">serial device</a> types, to
 
1059
      describe the host side of the tunnel; <code>type='tcp'</code>
 
1060
      or <code>type='spicevmc'</code> (which uses the smartcard
 
1061
      channel of a <a href="#elementsGraphics">SPICE graphics
 
1062
      device</a>) are typical.  Further sub-elements, such
 
1063
      as <code>&lt;source&gt;</code>, may be required according to the
 
1064
      given type, although a <code>&lt;target&gt;</code> sub-element
 
1065
      is not required (since the consumer of the character device is
 
1066
      the hypervisor itself, rather than a device visible in the
 
1067
      guest).</dd></dl>
 
1068
        <p>
 
1069
      Each mode supports an optional
 
1070
      sub-element <code>&lt;address&gt;</code>, which fine-tunes the
 
1071
      correlation between the smartcard and a ccid bus controller.
 
1072
      If present, the element must have an attribute
 
1073
      of <code>type='ccid'</code> as well as a <code>bus</code>
 
1074
      attribute listing the index of the bus that the smartcard
 
1075
      utilizes.  An optional <code>slot</code> attribute lists which
 
1076
      slot within the bus.  For now, qemu only supports at most one
 
1077
      smartcard, with an address of bus=0 slot=0.
 
1078
    </p>
 
1079
        <h4>
779
1080
          <a name="elementsNICS" id="elementsNICS">Network interfaces</a>
780
1081
        </h4>
781
1082
        <pre>
785
1086
      &lt;source bridge='xenbr0'/&gt;
786
1087
      &lt;mac address='00:16:3e:5d:c7:9e'/&gt;
787
1088
      &lt;script path='vif-bridge'/&gt;
 
1089
      &lt;boot order='1'/&gt;
788
1090
    &lt;/interface&gt;
789
1091
  &lt;/devices&gt;
790
1092
  ...</pre>
 
1093
        <p>
 
1094
      There are several possibilities for specifying a network
 
1095
      interface visible to the guest.  Each subsection below provides
 
1096
      more details about common setup options.  Additionally,
 
1097
      each <code>&lt;interface&gt;</code> element has an
 
1098
      optional <code>&lt;address&gt;</code> sub-element that can tie
 
1099
      the interface to a particular pci slot, with
 
1100
      attribute <code>type='pci'</code> and additional
 
1101
      attributes <code>domain</code>, <code>bus</code>, <code>slot</code>,
 
1102
      and <code>function</code> as appropriate.
 
1103
    </p>
791
1104
        <h5>
792
1105
          <a name="elementsNICSVirtual" id="elementsNICSVirtual">Virtual network</a>
793
1106
        </h5>
1038
1351
        hypervisors. Manually specified targets using these prefixes will be
1039
1352
        ignored.
1040
1353
    </p>
 
1354
        <h5>
 
1355
          <a name="elementsNICSBoot" id="elementsNICSBoot">Specifying boot order</a>
 
1356
        </h5>
 
1357
        <pre>
 
1358
  ...
 
1359
  &lt;devices&gt;
 
1360
    &lt;interface type='network'&gt;
 
1361
      &lt;source network='default'/&gt;
 
1362
      &lt;target dev='vnet1'/&gt;
 
1363
      <b>&lt;boot order='1'/&gt;</b>
 
1364
    &lt;/interface&gt;
 
1365
  &lt;/devices&gt;
 
1366
  ...</pre>
 
1367
        <p>
 
1368
      For hypervisors which support this, you can set exact NIC which should
 
1369
      be used for network boot. The <code>order</code> attribute determines
 
1370
      the order in which devices will be tried during boot sequence. The
 
1371
      per-device <code>boot</code> elements cannot be used together with
 
1372
      general boot elements in
 
1373
      <a href="#elementsOSBIOS">BIOS bootloader</a> section.
 
1374
      <span class="since">Since 0.8.8</span>
 
1375
    </p>
1041
1376
        <h4>
1042
1377
          <a name="elementsInput" id="elementsInput">Input devices</a>
1043
1378
        </h4>
1058
1393
        cursor movement, while the former uses relative movement. The optional
1059
1394
        <code>bus</code> attribute can be used to refine the exact device type.
1060
1395
        It takes values "xen" (paravirtualized), "ps2" and "usb".</dd></dl>
 
1396
        <p>
 
1397
      The <code>input</code> element has an optional
 
1398
      sub-element <code>&lt;address&gt;</code> which can tie the
 
1399
      device to a particular PCI slot.
 
1400
    </p>
1061
1401
        <h4>
1062
1402
          <a name="elementsGraphics" id="elementsGraphics">Graphical framebuffers</a>
1063
1403
        </h4>
1091
1431
  The <code>listen</code> attribute is an IP address for the server to
1092
1432
  listen on. The <code>passwd</code> attribute provides a VNC password
1093
1433
  in clear text. The <code>keymap</code> attribute specifies the keymap
1094
 
  to use.
 
1434
  to use. It is possible to set a limit on the validity of the password
 
1435
  be giving an timestamp <code>passwdValidTo='2010-04-09T15:51:00'</code>
 
1436
  assumed to be in UTC. NB, this may not be supported by all hypervisors.<br /><br />
 
1437
  Rather than using listen/port, QEMU supports a <code>socket</code>
 
1438
  attribute for listening on a unix domain socket path.
 
1439
  <span class="since">Since 0.8.8</span>
 
1440
          </dd><dt><code>"spice"</code></dt><dd>
 
1441
            <p>
 
1442
  Starts a SPICE server. The <code>port</code> attribute specifies the TCP
 
1443
  port number (with -1 as legacy syntax indicating that it should be
 
1444
  auto-allocated), while <code>tlsPort</code> gives an alternative
 
1445
  secure port number. The <code>autoport</code> attribute is the new
 
1446
  preferred syntax for indicating autoallocation of both port numbers.
 
1447
  The <code>listen</code> attribute is an IP address for the server to
 
1448
  listen on. The <code>passwd</code> attribute provides a SPICE password
 
1449
  in clear text. The <code>keymap</code> attribute specifies the keymap
 
1450
  to use. It is possible to set a limit on the validity of the password
 
1451
  be giving an timestamp <code>passwdValidTo='2010-04-09T15:51:00'</code>
 
1452
  assumed to be in UTC. NB, this may not be supported by all hypervisors.
 
1453
            </p>
 
1454
            <p>
 
1455
  When SPICE has both a normal and TLS secured TCP port configured, it
 
1456
  can be desirable to restrict what channels can be run on each port.
 
1457
  This is achieved by adding one or more &lt;channel&gt; elements inside
 
1458
  the main &lt;graphics&gt; element. Valid channel names include
 
1459
  <code>main</code>, <code>display</code>, <code>inputs</code>,
 
1460
  <code>cursor</code>, <code>playback</code>, <code>record</code>;
 
1461
  and <span class="since">since 0.8.8</span>: <code>smartcard</code>.
 
1462
            </p>
 
1463
            <pre>
 
1464
  &lt;graphics type='spice' port='-1' tlsPort='-1' autoport='yes'&gt;
 
1465
    &lt;channel name='main' mode='secure'/&gt;
 
1466
    &lt;channel name='record' mode='insecure'/&gt;
 
1467
  &lt;/graphics&gt;</pre>
1095
1468
          </dd><dt><code>"rdp"</code></dt><dd>
1096
1469
  Starts a RDP server. The <code>port</code> attribute
1097
1470
  specifies the TCP port number (with -1 as legacy syntax indicating
1130
1503
        video devices.
1131
1504
      </dd><dt><code>model</code></dt><dd>
1132
1505
        The <code>model</code> element has a mandatory <code>type</code>
1133
 
        attribute which takes the value "vga", "cirrus", "vmvga", "xen" or "vbox".
 
1506
        attribute which takes the value "vga", "cirrus", "vmvga", "qxl",
 
1507
        "xen" or "vbox", depending on the hypervisor features available.
1134
1508
        You can also provide the amount of video memory in kilobytes using
1135
1509
        <code>vram</code> and the number of screen with <code>heads</code>.
1136
1510
      </dd><dt><code>acceleration</code></dt><dd>
1137
1511
        If acceleration should be enabled (if supported) using the
1138
1512
        <code>accel3d</code> and <code>accel2d</code> attributes in the
1139
1513
        <code>acceleration</code> element.
 
1514
      </dd><dt><code>address</code></dt><dd>
 
1515
        The optional <code>address</code> sub-element can be used to
 
1516
        tie the video device to a particular PCI slot.
1140
1517
      </dd></dl>
1141
1518
        <h4>
1142
1519
          <a name="elementsConsole" id="elementsConsole">Consoles, serial, parallel &amp; channel devices</a>
1177
1554
      attribute of the top-level element. The host interface is
1178
1555
      configured by the <code>source</code> element.
1179
1556
    </p>
 
1557
        <p>
 
1558
      Each character device element has an optional
 
1559
      sub-element <code>&lt;address&gt;</code> which can tie the
 
1560
      device to a
 
1561
      particular <a href="#elementsControllers">controller</a> or PCI
 
1562
      slot.
 
1563
    </p>
1180
1564
        <h5>
1181
1565
          <a name="elementsCharGuestInterface" id="elementsCharGuestInterface">Guest interface</a>
1182
1566
        </h5>
1272
1656
    &lt;channel type='pty'&gt;
1273
1657
      &lt;target type='virtio' name='arbitrary.virtio.serial.port.name'/&gt;
1274
1658
    &lt;/channel&gt;
 
1659
    &lt;channel type='spicevmc'&gt;
 
1660
      &lt;target type='virtio' name='com.redhat.spice.0'/&gt;
 
1661
    &lt;/channel&gt;
1275
1662
  &lt;/devices&gt;
1276
1663
  ...</pre>
1277
1664
        <p>
1284
1671
        forwarded to the channel device on the host. The <code>target</code>
1285
1672
        element must have <code>address</code> and <code>port</code> attributes.
1286
1673
        <span class="since">Since 0.7.3</span></dd><dt><code>virtio</code></dt><dd>Paravirtualized virtio channel. Channel is exposed in the guest under
1287
 
        /dev/vport*, and if the optional element<code>name</code> is specified,
 
1674
        /dev/vport*, and if the optional element <code>name</code> is specified,
1288
1675
        /dev/virtio-ports/$name (for more info, please see
1289
 
        <a href="http://fedoraproject.org/wiki/Features/VirtioSerial">http://fedoraproject.org/wiki/Features/VirtioSerial</a>)
1290
 
        <span class="since">Since 0.7.7</span></dd></dl>
 
1676
        <a href="http://fedoraproject.org/wiki/Features/VirtioSerial">http://fedoraproject.org/wiki/Features/VirtioSerial</a>). The
 
1677
        optional element <code>address</code> can tie the channel to a
 
1678
        particular <code>type='virtio-serial'</code> controller.
 
1679
        <span class="since">Since 0.7.7</span></dd><dt><code>spicevmc</code></dt><dd>Paravirtualized SPICE channel. The domain must also have a
 
1680
        SPICE server as a <a href="#elementsGraphics">graphics
 
1681
        device</a>, at which point the host piggy-backs messages
 
1682
        across the <code>main</code> channel.  The <code>target</code>
 
1683
        element must be present, with
 
1684
        attribute <code>type='virtio'</code>; an optional
 
1685
        attribute <code>name</code> controls how the guest will have
 
1686
        access to the channel, and defaults
 
1687
        to <code>name='com.redhat.spice.0'</code>.  The
 
1688
        optional <code>address</code> element can tie the channel to a
 
1689
        particular <code>type='virtio-serial'</code> controller.
 
1690
        <span class="since">Since 0.8.8</span></dd></dl>
1291
1691
        <h5>
1292
1692
          <a name="elementsCharHostInterface" id="elementsCharHostInterface">Host interface</a>
1293
1693
        </h5>
1519
1919
        The <code>sound</code> element has one mandatory attribute,
1520
1920
        <code>model</code>, which specifies what real sound device is emulated.
1521
1921
        Valid values are specific to the underlying hypervisor, though typical
1522
 
        choices are 'es1370', 'sb16', and 'ac97'
1523
 
        (<span class="since">'ac97' only since 0.6.0</span>)
 
1922
        choices are 'es1370', 'sb16', 'ac97', and 'ich6'
 
1923
        (<span class="since">
 
1924
         'ac97' only since 0.6.0, 'ich6' only since 0.8.8</span>)
1524
1925
      </dd></dl>
 
1926
        <p>
 
1927
      Each <code>sound</code> element has an optional
 
1928
      sub-element <code>&lt;address&gt;</code> which can tie the
 
1929
      device to a particular PCI slot.
 
1930
    </p>
1525
1931
        <h4>
1526
1932
          <a name="elementsWatchdog" id="elementsWatchdog">Watchdog device</a>
1527
1933
        </h4>
1572
1978
        QEMU and KVM support:
1573
1979
        </p>
1574
1980
        <ul><li>'reset' — default, forcefully reset the guest</li><li>'shutdown' — gracefully shutdown the guest
1575
 
            (not recommended) </li><li>'poweroff' — forcefully power off the guest</li><li>'pause' — pause the guest</li><li>'none' — do nothing</li></ul><p>
1576
 
        Note that the 'shutdown' action requires that the guest
 
1981
            (not recommended) </li><li>'poweroff' — forcefully power off the guest</li><li>'pause' — pause the guest</li><li>'none' — do nothing</li><li>'dump' — automatically dump the guest
 
1982
            <span class="since">Since 0.8.7</span></li></ul><p>
 
1983
        Note 1: the 'shutdown' action requires that the guest
1577
1984
        is responsive to ACPI signals.  In the sort of situations
1578
1985
        where the watchdog has expired, guests are usually unable
1579
1986
        to respond to ACPI signals.  Therefore using 'shutdown'
1580
1987
        is not recommended.
1581
1988
        </p>
 
1989
        <p>
 
1990
        Note 2: the directory to save dump files can be configured
 
1991
        by <code>auto_dump_path</code> in file /etc/libvirt/qemu.conf.
 
1992
        </p>
1582
1993
      </dd></dl>
1583
1994
        <h4>
1584
1995
          <a name="elementsMemBalloon" id="elementsMemBalloon">Memory balloon device</a>
1616
2027
        <dl><dt><code>model</code></dt><dd>
1617
2028
        <p>
1618
2029
          The required <code>model</code> attribute specifies what type
1619
 
          of balloon device is provided. Valid values are specific to
1620
 
          the virtualization platform
 
2030
          of balloon device is provided. Valid values are specific to
 
2031
          the virtualization platform
1621
2032
        </p>
1622
2033
        <ul><li>'virtio' — default with QEMU/KVM</li><li>'xen' — default with Xen</li></ul></dd></dl>
1623
2034
        <h2>