]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
docs, schema, conf: Add support for PMU feature
authorMartin Kletzander <mkletzan@redhat.com>
Mon, 5 Jan 2015 15:21:51 +0000 (16:21 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Fri, 16 Jan 2015 12:43:46 +0000 (13:43 +0100)
Just a new feature that can be turned on/off.

https://bugzilla.redhat.com/show_bug.cgi?id=1178853

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
docs/formatdomain.html.in
docs/schemas/domaincommon.rng
src/conf/domain_conf.c
src/conf/domain_conf.h
tests/qemuxml2argvdata/qemuxml2argv-pmu-feature-off.xml [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-pmu-feature.xml [new file with mode: 0644]
tests/qemuxml2xmloutdata/qemuxml2xmlout-pmu-feature.xml [new file with mode: 0644]
tests/qemuxml2xmltest.c

index 1d69ca655618c6ad0bd2973dd0fe3efbc0e4199f..dca09b6a9922383a91d816f05075f08846d08ada 100644 (file)
         </tr>
       </table>
       </dd>
+      <dt><code>pmu</code></dt>
+      <dd>Depending on the <code>state</code> attribute (values <code>on</code>,
+        <code>off</code>, default <code>on</code>) enable or disable the
+        performance monitoring unit for the guest.
+        <span class="since">Since 1.2.12</span>
+      </dd>
     </dl>
 
     <h3><a name="elementsTime">Time keeping</a></h3>
index af7abd2e08b1f20ebeb536576cae1bf549fb0239..7fe1387972b5beaa2ddbec1bddbf15da6a2fd33d 100644 (file)
           <optional>
             <ref name="capabilities"/>
           </optional>
+          <optional>
+            <ref name="pmu"/>
+          </optional>
         </interleave>
       </element>
     </optional>
     </element>
   </define>
 
+  <define name="pmu">
+    <element name="pmu">
+      <optional>
+        <ref name="featurestate"/>
+      </optional>
+    </element>
+  </define>
+
   <define name="featurestate">
     <attribute name="state">
       <ref name="virOnOff"/>
index a112f933986c113d708aec8ac59314e4fde90a30..cdd64b1cdb78363f9631a5cac9bdef5eecd8dc6b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * domain_conf.c: domain XML processing
  *
- * Copyright (C) 2006-2014 Red Hat, Inc.
+ * Copyright (C) 2006-2015 Red Hat, Inc.
  * Copyright (C) 2006-2008 Daniel P. Berrange
  * Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
  *
@@ -138,7 +138,8 @@ VIR_ENUM_IMPL(virDomainFeature, VIR_DOMAIN_FEATURE_LAST,
               "hyperv",
               "kvm",
               "pvspinlock",
-              "capabilities")
+              "capabilities",
+              "pmu")
 
 VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, VIR_DOMAIN_CAPABILITIES_POLICY_LAST,
               "default",
@@ -13242,6 +13243,8 @@ virDomainDefParseXML(xmlDocPtr xml,
             }
             ctxt->node = node;
             break;
+
+        case VIR_DOMAIN_FEATURE_PMU:
         case VIR_DOMAIN_FEATURE_PVSPINLOCK:
             node = ctxt->node;
             ctxt->node = nodes[i];
@@ -19689,6 +19692,7 @@ virDomainDefFormatInternal(virDomainDefPtr def,
 
                 break;
 
+            case VIR_DOMAIN_FEATURE_PMU:
             case VIR_DOMAIN_FEATURE_PVSPINLOCK:
                 switch ((virTristateSwitch) def->features[i]) {
                 case VIR_TRISTATE_SWITCH_LAST:
index c1cc4991ed950187a5bf5cf527e6cfbb8ae2ffaa..1f77720a91607fefc19e41d9c51cb739db9ef9c3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * domain_conf.h: domain XML processing
  *
- * Copyright (C) 2006-2014 Red Hat, Inc.
+ * Copyright (C) 2006-2015 Red Hat, Inc.
  * Copyright (C) 2006-2008 Daniel P. Berrange
  * Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
  *
@@ -1605,6 +1605,7 @@ typedef enum {
     VIR_DOMAIN_FEATURE_KVM,
     VIR_DOMAIN_FEATURE_PVSPINLOCK,
     VIR_DOMAIN_FEATURE_CAPABILITIES,
+    VIR_DOMAIN_FEATURE_PMU,
 
     VIR_DOMAIN_FEATURE_LAST
 } virDomainFeature;
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pmu-feature-off.xml b/tests/qemuxml2argvdata/qemuxml2argv-pmu-feature-off.xml
new file mode 100644 (file)
index 0000000..2f16023
--- /dev/null
@@ -0,0 +1,25 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</currentMemory>
+  <vcpu placement='static'>6</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='network'/>
+  </os>
+  <features>
+    <acpi/>
+    <pmu state='off'/>
+  </features>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pmu-feature.xml b/tests/qemuxml2argvdata/qemuxml2argv-pmu-feature.xml
new file mode 100644 (file)
index 0000000..8a84703
--- /dev/null
@@ -0,0 +1,25 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</currentMemory>
+  <vcpu placement='static'>6</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='network'/>
+  </os>
+  <features>
+    <acpi/>
+    <pmu/>
+  </features>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pmu-feature.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pmu-feature.xml
new file mode 100644 (file)
index 0000000..7f23253
--- /dev/null
@@ -0,0 +1,25 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</currentMemory>
+  <vcpu placement='static'>6</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='network'/>
+  </os>
+  <features>
+    <acpi/>
+    <pmu state='on'/>
+  </features>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
index 0d799b2197fbfe52c6dc3fff80aa592a97c296b5..43db21b2b27a01ab3c0388a943544562d324f4e3 100644 (file)
@@ -205,6 +205,9 @@ mymain(void)
     DO_TEST("kvm-features");
     DO_TEST("kvm-features-off");
 
+    DO_TEST_DIFFERENT("pmu-feature");
+    DO_TEST("pmu-feature-off");
+
     DO_TEST("hugepages");
     DO_TEST("hugepages-pages");
     DO_TEST("hugepages-pages2");