From 199390117c9ad010c2cc84a152943a5f006ec2b1 Mon Sep 17 00:00:00 2001 From: Martin Kletzander Date: Mon, 5 Jan 2015 16:21:51 +0100 Subject: [PATCH] docs, schema, conf: Add support for PMU feature Just a new feature that can be turned on/off. https://bugzilla.redhat.com/show_bug.cgi?id=1178853 Signed-off-by: Martin Kletzander --- docs/formatdomain.html.in | 6 +++++ docs/schemas/domaincommon.rng | 11 ++++++++ src/conf/domain_conf.c | 8 ++++-- src/conf/domain_conf.h | 3 ++- .../qemuxml2argv-pmu-feature-off.xml | 25 +++++++++++++++++++ .../qemuxml2argv-pmu-feature.xml | 25 +++++++++++++++++++ .../qemuxml2xmlout-pmu-feature.xml | 25 +++++++++++++++++++ tests/qemuxml2xmltest.c | 3 +++ 8 files changed, 103 insertions(+), 3 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pmu-feature-off.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pmu-feature.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pmu-feature.xml diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 1d69ca6556..dca09b6a99 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1456,6 +1456,12 @@ +
pmu
+
Depending on the state attribute (values on, + off, default on) enable or disable the + performance monitoring unit for the guest. + Since 1.2.12 +

Time keeping

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index af7abd2e08..7fe1387972 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4054,6 +4054,9 @@ + + + @@ -4879,6 +4882,14 @@ + + + + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index a112f93398..cdd64b1cdb 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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: diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index c1cc4991ed..1f77720a91 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -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 index 0000000000..2f16023d6a --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pmu-feature-off.xml @@ -0,0 +1,25 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 6 + + hvm + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pmu-feature.xml b/tests/qemuxml2argvdata/qemuxml2argv-pmu-feature.xml new file mode 100644 index 0000000000..8a84703e64 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pmu-feature.xml @@ -0,0 +1,25 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 6 + + hvm + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu + + + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pmu-feature.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pmu-feature.xml new file mode 100644 index 0000000000..7f23253933 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pmu-feature.xml @@ -0,0 +1,25 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 6 + + hvm + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu + + + + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 0d799b2197..43db21b2b2 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -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");