mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-04 00:58:38 +03:00
Added <features> tag to XML for enable CPU/system features like PAE, ACPI
This commit is contained in:
parent
86a22bd660
commit
075337182c
@ -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>
|
||||
|
||||
* docs/libvir.html, docs/format.html: Updated description of
|
||||
|
@ -99,13 +99,18 @@ systems:</p><pre><domain type='xen' id='3'>
|
||||
<os>
|
||||
<span style="color: #0000E5; background-color: #FFFFFF"><type>hvm</type></span>
|
||||
<span style="color: #0000E5; background-color: #FFFFFF"><loader>/usr/lib/xen/boot/hvmloader</loader></span>
|
||||
<span style="color: #0000E5; background-color: #FFFFFF"><boot dev='da'/></span>
|
||||
<span style="color: #0000E5; background-color: #FFFFFF"><boot dev='hd'/></span>
|
||||
</os>
|
||||
<memory>524288</memory>
|
||||
<vcpu>1</vcpu>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>restart</on_crash>
|
||||
<features>
|
||||
<span style="color: #E50000; background-color: #FFFFFF"><pae/>
|
||||
<acpi/>
|
||||
<apic/></span>
|
||||
</features>
|
||||
<devices>
|
||||
<span style="color: #0000E5; background-color: #FFFFFF"><emulator>/usr/lib/xen/bin/qemu-dm</emulator></span>
|
||||
<interface type='bridge'>
|
||||
@ -128,7 +133,13 @@ systems:</p><pre><domain type='xen' id='3'>
|
||||
</disk>
|
||||
<span style="color: #0000E5; background-color: #FFFFFF"><graphics type='vnc' port='5904'/></span>
|
||||
</devices>
|
||||
</domain></pre><p>There is a few things to notice specifically for HVM domains:</p><ul><li>the <code><os></code> block description is very different, first it indicates
|
||||
</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 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><os></code> block description is very different, first it indicates
|
||||
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
|
||||
which will extract the boot informations from the boot device specified
|
||||
|
@ -430,6 +430,11 @@ systems:</p>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>restart</on_crash>
|
||||
<features>
|
||||
<span style="color: #E50000; background-color: #FFFFFF"><pae/>
|
||||
<acpi/>
|
||||
<apic/></span>
|
||||
</features>
|
||||
<devices>
|
||||
<span style="color: #0000E5; background-color: #FFFFFF"><emulator>/usr/lib/xen/bin/qemu-dm</emulator></span>
|
||||
<interface type='bridge'>
|
||||
@ -456,6 +461,14 @@ systems:</p>
|
||||
|
||||
<p>There is a few things to notice specifically for HVM domains:</p>
|
||||
<ul>
|
||||
<li>the optional <code><features></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><os></code> block description is very different, first it indicates
|
||||
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
|
||||
|
@ -1547,6 +1547,17 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root)
|
||||
if (tmp != NULL)
|
||||
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);
|
||||
|
||||
/* in case of HVM we have devices emulation */
|
||||
|
24
src/xml.c
24
src/xml.c
@ -567,7 +567,7 @@ virDomainGetXMLDesc(virDomainPtr domain, int flags)
|
||||
return (ret);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* 0 - UNUSED */
|
||||
|
||||
#ifndef PROXY
|
||||
/**
|
||||
@ -695,6 +695,28 @@ virDomainParseXMLOSDescHVM(xmlNodePtr node, virBufferPtr buf, xmlXPathContextPtr
|
||||
xmlXPathFreeObject(obj);
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user