]> xenbits.xensource.com Git - libvirt.git/commitdiff
Added <features> tag to XML for enable CPU/system features like PAE, ACPI
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 15 Aug 2006 17:01:42 +0000 (17:01 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 15 Aug 2006 17:01:42 +0000 (17:01 +0000)
ChangeLog
docs/format.html
docs/libvir.html
src/xend_internal.c
src/xml.c

index 4482714db4ee5a93befdeda212265c35bd1828db..7ee70d7f6b6cd8d22c9c015c53746309c7fb6ad7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index af71e9a21be6f75227804c784b0cbe720ba8e310..64a6f2da6fb7367f71c8fb1eb8762df007575de0 100644 (file)
@@ -99,13 +99,18 @@ systems:</p><pre>&lt;domain type='xen' id='3'&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;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;memory&gt;524288&lt;/memory&gt;
   &lt;vcpu&gt;1&lt;/vcpu&gt;
   &lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;
   &lt;on_reboot&gt;restart&lt;/on_reboot&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;
     <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;
@@ -128,7 +133,13 @@ systems:</p><pre>&lt;domain type='xen' id='3'&gt;
     &lt;/disk&gt;
     <span style="color: #0000E5; background-color: #FFFFFF">&lt;graphics type='vnc' port='5904'/&gt;</span>
   &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
     kernel, boot and command line arguments, it points to an os boot loader
     which will extract the boot informations from the boot device specified
index 4ad76554f64a8f0a58edc22fa76b48b91ee1d14a..d7bedafd2d40c38d50fc6dacf64d2d33277b5cc9 100644 (file)
@@ -430,6 +430,11 @@ systems:</p>
   &lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;
   &lt;on_reboot&gt;restart&lt;/on_reboot&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;
     <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;
@@ -456,6 +461,14 @@ systems:</p>
 
 <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
     kernel, boot and command line arguments, it points to an os boot loader
index 810162a01c114c558c609b7864815a0c7475d83e..f0fbc568b0129bf67994dc6c5235db08f39c59f9 100644 (file)
@@ -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 */
index 255a64241788c3a4a2a5e3693a6d2449cf09c79c..8bae273009b937f913d2c32a30b353561f936222 100644 (file)
--- a/src/xml.c
+++ b/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);