Added <features> tag to XML for enable CPU/system features like PAE, ACPI

This commit is contained in:
Daniel P. Berrange 2006-08-15 17:01:42 +00:00
parent 86a22bd660
commit 075337182c
5 changed files with 68 additions and 3 deletions

View File

@ -1,3 +1,11 @@
Tue Aug 15 11:55:15 EDT 2006 Daniel Berrange <berrange@redhat.com>
* src/xml.c, src/xend_internal.c: Added a <features> block
to XML allowing enablement of guest CPU / system features.
Currently support PAE, ACPI, APIC for HVM domains.
* docs/libvir.html: Documented new <features> block and those
features enabled for HVM guests
Mon Aug 14 10:55:02 EDT 2006 Daniel Berrange <berrange@redhat.com> Mon Aug 14 10:55:02 EDT 2006 Daniel Berrange <berrange@redhat.com>
* docs/libvir.html, docs/format.html: Updated description of * docs/libvir.html, docs/format.html: Updated description of

View File

@ -99,13 +99,18 @@ systems:</p><pre>&lt;domain type='xen' id='3'&gt;
&lt;os&gt; &lt;os&gt;
<span style="color: #0000E5; background-color: #FFFFFF">&lt;type&gt;hvm&lt;/type&gt;</span> <span style="color: #0000E5; background-color: #FFFFFF">&lt;type&gt;hvm&lt;/type&gt;</span>
<span style="color: #0000E5; background-color: #FFFFFF">&lt;loader&gt;/usr/lib/xen/boot/hvmloader&lt;/loader&gt;</span> <span style="color: #0000E5; background-color: #FFFFFF">&lt;loader&gt;/usr/lib/xen/boot/hvmloader&lt;/loader&gt;</span>
<span style="color: #0000E5; background-color: #FFFFFF">&lt;boot dev='da'/&gt;</span> <span style="color: #0000E5; background-color: #FFFFFF">&lt;boot dev='hd'/&gt;</span>
&lt;/os&gt; &lt;/os&gt;
&lt;memory&gt;524288&lt;/memory&gt; &lt;memory&gt;524288&lt;/memory&gt;
&lt;vcpu&gt;1&lt;/vcpu&gt; &lt;vcpu&gt;1&lt;/vcpu&gt;
&lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt; &lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;
&lt;on_reboot&gt;restart&lt;/on_reboot&gt; &lt;on_reboot&gt;restart&lt;/on_reboot&gt;
&lt;on_crash&gt;restart&lt;/on_crash&gt; &lt;on_crash&gt;restart&lt;/on_crash&gt;
&lt;features&gt;
<span style="color: #E50000; background-color: #FFFFFF">&lt;pae/&gt;
&lt;acpi/&gt;
&lt;apic/&gt;</span>
&lt;/features&gt;
&lt;devices&gt; &lt;devices&gt;
<span style="color: #0000E5; background-color: #FFFFFF">&lt;emulator&gt;/usr/lib/xen/bin/qemu-dm&lt;/emulator&gt;</span> <span style="color: #0000E5; background-color: #FFFFFF">&lt;emulator&gt;/usr/lib/xen/bin/qemu-dm&lt;/emulator&gt;</span>
&lt;interface type='bridge'&gt; &lt;interface type='bridge'&gt;
@ -128,7 +133,13 @@ systems:</p><pre>&lt;domain type='xen' id='3'&gt;
&lt;/disk&gt; &lt;/disk&gt;
<span style="color: #0000E5; background-color: #FFFFFF">&lt;graphics type='vnc' port='5904'/&gt;</span> <span style="color: #0000E5; background-color: #FFFFFF">&lt;graphics type='vnc' port='5904'/&gt;</span>
&lt;/devices&gt; &lt;/devices&gt;
&lt;/domain&gt;</pre><p>There is a few things to notice specifically for HVM domains:</p><ul><li>the <code>&lt;os&gt;</code> block description is very different, first it indicates &lt;/domain&gt;</pre><p>There is a few things to notice specifically for HVM domains:</p><ul><li>the optional <code>&lt;features&gt;</code> block is used to enable certain
guest CPU / system features. For HVM guests the following features are defined:
<ul><li><code>pae</code> - enable PAE memory addressing</li>
<li><code>apic</code> - enable IO APIC</li>
<li><code>acpi</code> - enable ACPI bios</li>
</ul></li>
<li>the <code>&lt;os&gt;</code> block description is very different, first it indicates
that the type is 'hvm' for hardware virtualization, then instead of a that the type is 'hvm' for hardware virtualization, then instead of a
kernel, boot and command line arguments, it points to an os boot loader kernel, boot and command line arguments, it points to an os boot loader
which will extract the boot informations from the boot device specified which will extract the boot informations from the boot device specified

View File

@ -430,6 +430,11 @@ systems:</p>
&lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt; &lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;
&lt;on_reboot&gt;restart&lt;/on_reboot&gt; &lt;on_reboot&gt;restart&lt;/on_reboot&gt;
&lt;on_crash&gt;restart&lt;/on_crash&gt; &lt;on_crash&gt;restart&lt;/on_crash&gt;
&lt;features&gt;
<span style="color: #E50000; background-color: #FFFFFF">&lt;pae/&gt;
&lt;acpi/&gt;
&lt;apic/&gt;</span>
&lt;/features&gt;
&lt;devices&gt; &lt;devices&gt;
<span style="color: #0000E5; background-color: #FFFFFF">&lt;emulator&gt;/usr/lib/xen/bin/qemu-dm&lt;/emulator&gt;</span> <span style="color: #0000E5; background-color: #FFFFFF">&lt;emulator&gt;/usr/lib/xen/bin/qemu-dm&lt;/emulator&gt;</span>
&lt;interface type='bridge'&gt; &lt;interface type='bridge'&gt;
@ -456,6 +461,14 @@ systems:</p>
<p>There is a few things to notice specifically for HVM domains:</p> <p>There is a few things to notice specifically for HVM domains:</p>
<ul> <ul>
<li>the optional <code>&lt;features&gt;</code> block is used to enable certain
guest CPU / system features. For HVM guests the following features are defined:
<ul>
<li><code>pae</code> - enable PAE memory addressing</li>
<li><code>apic</code> - enable IO APIC</li>
<li><code>acpi</code> - enable ACPI bios</li>
</ul>
</li>
<li>the <code>&lt;os&gt;</code> block description is very different, first it indicates <li>the <code>&lt;os&gt;</code> block description is very different, first it indicates
that the type is 'hvm' for hardware virtualization, then instead of a that the type is 'hvm' for hardware virtualization, then instead of a
kernel, boot and command line arguments, it points to an os boot loader kernel, boot and command line arguments, it points to an os boot loader

View File

@ -1547,6 +1547,17 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root)
if (tmp != NULL) if (tmp != NULL)
virBufferVSprintf(&buf, " <on_crash>%s</on_crash>\n", tmp); virBufferVSprintf(&buf, " <on_crash>%s</on_crash>\n", tmp);
if (hvm) {
virBufferAdd(&buf, " <features>\n", 13);
if (sexpr_int(root, "domain/image/hvm/acpi"))
virBufferAdd(&buf, " <acpi/>\n", 12);
if (sexpr_int(root, "domain/image/hvm/apic"))
virBufferAdd(&buf, " <apic/>\n", 12);
if (sexpr_int(root, "domain/image/hvm/pae"))
virBufferAdd(&buf, " <pae/>\n", 11);
virBufferAdd(&buf, " </features>\n", 14);
}
virBufferAdd(&buf, " <devices>\n", 12); virBufferAdd(&buf, " <devices>\n", 12);
/* in case of HVM we have devices emulation */ /* in case of HVM we have devices emulation */

View File

@ -567,7 +567,7 @@ virDomainGetXMLDesc(virDomainPtr domain, int flags)
return (ret); return (ret);
} }
#endif #endif /* 0 - UNUSED */
#ifndef PROXY #ifndef PROXY
/** /**
@ -695,6 +695,28 @@ virDomainParseXMLOSDescHVM(xmlNodePtr node, virBufferPtr buf, xmlXPathContextPtr
xmlXPathFreeObject(obj); xmlXPathFreeObject(obj);
obj = NULL; obj = NULL;
} }
obj = xmlXPathEval(BAD_CAST "/domain/features/acpi", ctxt);
if ((obj != NULL) && (obj->type == XPATH_NODESET) &&
(obj->nodesetval != NULL) && (obj->nodesetval->nodeNr == 1)) {
virBufferAdd(buf, "(acpi 1)", 8);
xmlXPathFreeObject(obj);
obj = NULL;
}
obj = xmlXPathEval(BAD_CAST "/domain/features/apic", ctxt);
if ((obj != NULL) && (obj->type == XPATH_NODESET) &&
(obj->nodesetval != NULL) && (obj->nodesetval->nodeNr == 1)) {
virBufferAdd(buf, "(apic 1)", 8);
xmlXPathFreeObject(obj);
obj = NULL;
}
obj = xmlXPathEval(BAD_CAST "/domain/features/pae", ctxt);
if ((obj != NULL) && (obj->type == XPATH_NODESET) &&
(obj->nodesetval != NULL) && (obj->nodesetval->nodeNr == 1)) {
virBufferAdd(buf, "(pae 1)", 7);
xmlXPathFreeObject(obj);
obj = NULL;
}
} }
obj = xmlXPathEval(BAD_CAST "count(domain/devices/console) > 0", ctxt); obj = xmlXPathEval(BAD_CAST "count(domain/devices/console) > 0", ctxt);