<htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-Type"content="text/html; charset=ISO-8859-1"/><linkrel="stylesheet"type="text/css"href="libvirt.css"/><linkrel="SHORTCUT ICON"href="/32favicon.png"/><title>XML Format</title></head><body><divid="container"><divid="intro"><divid="adjustments"></div><divid="pageHeader"></div><divid="content2"><h1class="style1">XML Format</h1><p>This section describes the XML format used to represent domains, there
arevariations on the format based on the kind of domains run and the
optionsused to launch them:</p><ul><li><ahref="#Normal1">Normal paravirtualized Xen domains</a></li>
</ul><p>The formats try as much as possible to follow the same structure and
reuseelements and attributes where it makes sense.</p><h3id="Normal"><aname="Normal1"id="Normal1">Normal paravirtualized
Xendomains</a>:</h3><p>The library use an XML format to describe domains, as input to <ahref="html/libvirt-libvirt.html#virDomainCreateLinux">virDomainCreateLinux()</a>and
as the output of <ahref="html/libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc()</a>,the
following is an example of the format as returned by the shell
command<code>virsh xmldump fc4</code>, where fc4 was one of the running
</domain></pre><p>There is a few things to notice specifically for HVM domains:</p><ul><li>the optional <code><features></code>block is used to
enablecertain guest CPU / system features. For HVM guests the
For Xen 3.0.2 and earlier a CDROM device can only be emulated on
the<code>hdc</code>channel, while for 3.0.3 and later, it can be
emulatedon any IDE channel.</li>
<li>the <code><devices></code>section also include at least oneentry
for the graphic device used to render the os. Currently there isjust 2
types possible 'vnc' or 'sdl'. If the type is 'vnc', then anadditional
<code>port</code>attribute will be present indicating the TCPport on
which the VNC server is accepting client connections.</li>
</ul><p>It is likely that the HVM description gets additional optional elementsand
attributes as the support for fully virtualized domain expands,especially for
the variety of devices emulated and the graphic supportoptions offered.</p><h3><aname="KVM1"id="KVM1">KVM domain (added in 0.2.0)</a></h3><p>Support for the KVM virtualization is provided in recent Linux kernels
(2.6.20 and onward). This requires specific hardware with acceleration
support and the availability of the special version of the <ahref="http://fabrice.bellard.free.fr/qemu/">QEmu</a> binary. Since this
relies on QEmu for the machine emulation like fully virtualized guests the
XML description is quite similar, here is a simple example:</p><pre><domain <spanstyle="color: #FF0000; background-color: #FFFFFF">type='kvm'</span>>
</domain></pre><p>The specific points to note if using KVM are:</p><ul><li>the top level domain element carries a type of 'kvm'</li>
<li>the <devices> emulator points to the special qemu binary required
for KVM</li>
<li>networking interface definitions definitions are somewhat different due
to a different model from Xen (@@TODO)</li>
</ul><p>except those points the options should be quite similar to Xen HVM
ones.</p><h3><aname="QEmu1"id="QEmu1">QEmu domain (added in 0.2.0)</a></h3><p></p></div></div><divclass="linkList2"><divclass="llinks2"><h3class="links2"><span>main menu</span></h3><ul><li><ahref="index.html">Home</a></li><li><ahref="news.html">Releases</a></li><li><ahref="intro.html">Introduction</a></li><li><ahref="architecture.html">libvirt architecture</a></li><li><ahref="downloads.html">Downloads</a></li><li><ahref="format.html">XML Format</a></li><li><ahref="python.html">Binding for Python</a></li><li><ahref="errors.html">Handling of errors</a></li><li><ahref="FAQ.html">FAQ</a></li><li><ahref="bugs.html">Reporting bugs and getting help</a></li><li><ahref="html/index.html">API Menu</a></li><li><ahref="examples/index.html">C code examples</a></li><li><ahref="ChangeLog.html">Recent Changes</a></li></ul></div><divclass="llinks2"><h3class="links2"><span>related links</span></h3><ul><li><ahref="https://www.redhat.com/archives/libvir-list/">Mail archive</a></li><li><ahref="https://bugzilla.redhat.com/bugzilla/buglist.cgi?product=Fedora+Core&component=libvirt&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=MODIFIED&short_desc_type=allwordssubstr&short_desc=&long_desc_type=allwordssubstr">Open bugs</a></li><li><ahref="http://virt-manager.et.redhat.com/">virt-manager</a></li><li><ahref="http://search.cpan.org/~danberr/Sys-Virt-0.1.0/">Perl bindings</a></li><li><ahref="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen project</a></li><li><formaction="search.php"enctype="application/x-www-form-urlencoded"method="get"><inputname="query"type="text"size="12"value="Search..."/><inputname="submit"type="submit"value="Go"/></form></li><li><ahref="http://xmlsoft.org/"><imgsrc="Libxml2-Logo-90x34.gif"alt="Made with Libxml2 Logo"/></a></li></ul><pclass="credits">Graphics and design by <ahref="mail:dfong@redhat.com">Diana Fong</a></p></div></div><divid="bottom"><pclass="p1"></p></div></div></body></html>