|
|
0a7476 |
From 1240e6d5b3d53a34a94b308ddf2f10a12f2556f6 Mon Sep 17 00:00:00 2001
|
|
|
0a7476 |
Message-Id: <1240e6d5b3d53a34a94b308ddf2f10a12f2556f6@dist-git>
|
|
|
0a7476 |
From: Bing Niu <bing.niu@intel.com>
|
|
|
0a7476 |
Date: Mon, 15 Apr 2019 17:32:58 +0200
|
|
|
0a7476 |
Subject: [PATCH] conf: Add support for memorytune XML processing for resctrl
|
|
|
0a7476 |
MBA
|
|
|
0a7476 |
MIME-Version: 1.0
|
|
|
0a7476 |
Content-Type: text/plain; charset=UTF-8
|
|
|
0a7476 |
Content-Transfer-Encoding: 8bit
|
|
|
0a7476 |
|
|
|
0a7476 |
Introduce a new section memorytune to support memory bandwidth allocation.
|
|
|
0a7476 |
This is consistent with existing cachetune. As the example:
|
|
|
0a7476 |
below:
|
|
|
0a7476 |
<cputune>
|
|
|
0a7476 |
......
|
|
|
0a7476 |
<memorytune vcpus='0'>
|
|
|
0a7476 |
<node id='0' bandwidth='30'/>
|
|
|
0a7476 |
</memorytune>
|
|
|
0a7476 |
</cputune>
|
|
|
0a7476 |
|
|
|
0a7476 |
vpus --- vpus subjected to this memory bandwidth.
|
|
|
0a7476 |
id --- on which node memory bandwidth to be set.
|
|
|
0a7476 |
bandwidth --- the memory bandwidth percent to set.
|
|
|
0a7476 |
|
|
|
0a7476 |
Signed-off-by: Bing Niu <bing.niu@intel.com>
|
|
|
0a7476 |
Reviewed-by: John Ferlan <jferlan@redhat.com>
|
|
|
0a7476 |
(cherry picked from commit 6956b7eedce4cb6dc2f95684fc3e10c163dfc6fc)
|
|
|
0a7476 |
|
|
|
0a7476 |
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468650
|
|
|
0a7476 |
|
|
|
0a7476 |
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
0a7476 |
Message-Id: <3139e3b8f3c3d66891847b5a99bd9125ec01f00b.1555342313.git.phrdina@redhat.com>
|
|
|
0a7476 |
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
|
0a7476 |
---
|
|
|
0a7476 |
docs/formatdomain.html.in | 39 +++-
|
|
|
0a7476 |
docs/schemas/domaincommon.rng | 17 ++
|
|
|
0a7476 |
src/conf/domain_conf.c | 200 ++++++++++++++++++
|
|
|
0a7476 |
.../memorytune-colliding-allocs.xml | 30 +++
|
|
|
0a7476 |
.../memorytune-colliding-cachetune.xml | 32 +++
|
|
|
0a7476 |
tests/genericxml2xmlindata/memorytune.xml | 33 +++
|
|
|
0a7476 |
tests/genericxml2xmltest.c | 5 +
|
|
|
0a7476 |
7 files changed, 355 insertions(+), 1 deletion(-)
|
|
|
0a7476 |
create mode 100644 tests/genericxml2xmlindata/memorytune-colliding-allocs.xml
|
|
|
0a7476 |
create mode 100644 tests/genericxml2xmlindata/memorytune-colliding-cachetune.xml
|
|
|
0a7476 |
create mode 100644 tests/genericxml2xmlindata/memorytune.xml
|
|
|
0a7476 |
|
|
|
0a7476 |
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
|
|
|
0a7476 |
index 42acf7a828..8cf2c12524 100644
|
|
|
0a7476 |
--- a/docs/formatdomain.html.in
|
|
|
0a7476 |
+++ b/docs/formatdomain.html.in
|
|
|
0a7476 |
@@ -757,6 +757,10 @@
|
|
|
0a7476 |
<cache id='0' level='3' type='both' size='3' unit='MiB'/>
|
|
|
0a7476 |
<cache id='1' level='3' type='both' size='3' unit='MiB'/>
|
|
|
0a7476 |
</cachetune>
|
|
|
0a7476 |
+ <memorytune vcpus='0-3'>
|
|
|
0a7476 |
+ <node id='0' bandwidth='60'/>
|
|
|
0a7476 |
+ </memorytune>
|
|
|
0a7476 |
+
|
|
|
0a7476 |
</cputune>
|
|
|
0a7476 |
...
|
|
|
0a7476 |
</domain>
|
|
|
0a7476 |
@@ -910,7 +914,9 @@
|
|
|
0a7476 |
size and required granularity are reported as well. The required
|
|
|
0a7476 |
attribute vcpus specifies to which vCPUs this allocation
|
|
|
0a7476 |
applies. A vCPU can only be member of one cachetune element
|
|
|
0a7476 |
- allocations. Supported subelements are:
|
|
|
0a7476 |
+ allocation. The vCPUs specified by cachetune can be identical with those
|
|
|
0a7476 |
+ in memorytune, however they are not allowed to overlap.
|
|
|
0a7476 |
+ Supported subelements are:
|
|
|
0a7476 |
|
|
|
0a7476 |
cache
|
|
|
0a7476 |
|
|
|
0a7476 |
@@ -950,7 +956,38 @@
|
|
|
0a7476 |
|
|
|
0a7476 |
|
|
|
0a7476 |
|
|
|
0a7476 |
+
|
|
|
0a7476 |
|
|
|
0a7476 |
+ memorytune Since 4.7.0
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ Optional memorytune element can control allocations for
|
|
|
0a7476 |
+ memory bandwidth using the resctrl on the host. Whether or not is this
|
|
|
0a7476 |
+ supported can be gathered from capabilities where some limitations like
|
|
|
0a7476 |
+ minimum bandwidth and required granularity are reported as well. The
|
|
|
0a7476 |
+ required attribute vcpus specifies to which vCPUs this
|
|
|
0a7476 |
+ allocation applies. A vCPU can only be member of one
|
|
|
0a7476 |
+ memorytune element allocation. The vcpus specified
|
|
|
0a7476 |
+ by memorytune can be identical to those specified by
|
|
|
0a7476 |
+ cachetune . However they are not allowed to overlap each other.
|
|
|
0a7476 |
+ Supported subelements are:
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ node
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ This element controls the allocation of CPU memory bandwidth and has the
|
|
|
0a7476 |
+ following attributes:
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ id
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ Host node id from which to allocate memory bandwidth.
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ bandwidth
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ The memory bandwidth to allocate from this node. The value by default
|
|
|
0a7476 |
+ is in percentage.
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+
|
|
|
0a7476 |
|
|
|
0a7476 |
|
|
|
0a7476 |
|
|
|
0a7476 |
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
|
|
|
0a7476 |
index ac04af51a1..48f0637cad 100644
|
|
|
0a7476 |
--- a/docs/schemas/domaincommon.rng
|
|
|
0a7476 |
+++ b/docs/schemas/domaincommon.rng
|
|
|
0a7476 |
@@ -983,6 +983,23 @@
|
|
|
0a7476 |
</oneOrMore>
|
|
|
0a7476 |
</element>
|
|
|
0a7476 |
</zeroOrMore>
|
|
|
0a7476 |
+ <zeroOrMore>
|
|
|
0a7476 |
+ <element name="memorytune">
|
|
|
0a7476 |
+ <attribute name="vcpus">
|
|
|
0a7476 |
+ <ref name='cpuset'/>
|
|
|
0a7476 |
+ </attribute>
|
|
|
0a7476 |
+ <oneOrMore>
|
|
|
0a7476 |
+ <element name="node">
|
|
|
0a7476 |
+ <attribute name="id">
|
|
|
0a7476 |
+ <ref name='unsignedInt'/>
|
|
|
0a7476 |
+ </attribute>
|
|
|
0a7476 |
+ <attribute name="bandwidth">
|
|
|
0a7476 |
+ <ref name='unsignedInt'/>
|
|
|
0a7476 |
+ </attribute>
|
|
|
0a7476 |
+ </element>
|
|
|
0a7476 |
+ </oneOrMore>
|
|
|
0a7476 |
+ </element>
|
|
|
0a7476 |
+ </zeroOrMore>
|
|
|
0a7476 |
</interleave>
|
|
|
0a7476 |
</element>
|
|
|
0a7476 |
</define>
|
|
|
0a7476 |
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
|
|
0a7476 |
index 44bfd75b72..2f56c077a9 100644
|
|
|
0a7476 |
--- a/src/conf/domain_conf.c
|
|
|
0a7476 |
+++ b/src/conf/domain_conf.c
|
|
|
0a7476 |
@@ -19296,6 +19296,129 @@ virDomainCachetuneDefParse(virDomainDefPtr def,
|
|
|
0a7476 |
}
|
|
|
0a7476 |
|
|
|
0a7476 |
|
|
|
0a7476 |
+static int
|
|
|
0a7476 |
+virDomainMemorytuneDefParseMemory(xmlXPathContextPtr ctxt,
|
|
|
0a7476 |
+ xmlNodePtr node,
|
|
|
0a7476 |
+ virResctrlAllocPtr alloc)
|
|
|
0a7476 |
+{
|
|
|
0a7476 |
+ xmlNodePtr oldnode = ctxt->node;
|
|
|
0a7476 |
+ unsigned int id;
|
|
|
0a7476 |
+ unsigned int bandwidth;
|
|
|
0a7476 |
+ char *tmp = NULL;
|
|
|
0a7476 |
+ int ret = -1;
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ ctxt->node = node;
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ tmp = virXMLPropString(node, "id");
|
|
|
0a7476 |
+ if (!tmp) {
|
|
|
0a7476 |
+ virReportError(VIR_ERR_XML_ERROR, "%s",
|
|
|
0a7476 |
+ _("Missing memorytune attribute 'id'"));
|
|
|
0a7476 |
+ goto cleanup;
|
|
|
0a7476 |
+ }
|
|
|
0a7476 |
+ if (virStrToLong_uip(tmp, NULL, 10, &id) < 0) {
|
|
|
0a7476 |
+ virReportError(VIR_ERR_XML_ERROR,
|
|
|
0a7476 |
+ _("Invalid memorytune attribute 'id' value '%s'"),
|
|
|
0a7476 |
+ tmp);
|
|
|
0a7476 |
+ goto cleanup;
|
|
|
0a7476 |
+ }
|
|
|
0a7476 |
+ VIR_FREE(tmp);
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ tmp = virXMLPropString(node, "bandwidth");
|
|
|
0a7476 |
+ if (!tmp) {
|
|
|
0a7476 |
+ virReportError(VIR_ERR_XML_ERROR, "%s",
|
|
|
0a7476 |
+ _("Missing memorytune attribute 'bandwidth'"));
|
|
|
0a7476 |
+ goto cleanup;
|
|
|
0a7476 |
+ }
|
|
|
0a7476 |
+ if (virStrToLong_uip(tmp, NULL, 10, &bandwidth) < 0) {
|
|
|
0a7476 |
+ virReportError(VIR_ERR_XML_ERROR,
|
|
|
0a7476 |
+ _("Invalid memorytune attribute 'bandwidth' value '%s'"),
|
|
|
0a7476 |
+ tmp);
|
|
|
0a7476 |
+ goto cleanup;
|
|
|
0a7476 |
+ }
|
|
|
0a7476 |
+ VIR_FREE(tmp);
|
|
|
0a7476 |
+ if (virResctrlAllocSetMemoryBandwidth(alloc, id, bandwidth) < 0)
|
|
|
0a7476 |
+ goto cleanup;
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ ret = 0;
|
|
|
0a7476 |
+ cleanup:
|
|
|
0a7476 |
+ ctxt->node = oldnode;
|
|
|
0a7476 |
+ VIR_FREE(tmp);
|
|
|
0a7476 |
+ return ret;
|
|
|
0a7476 |
+}
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+static int
|
|
|
0a7476 |
+virDomainMemorytuneDefParse(virDomainDefPtr def,
|
|
|
0a7476 |
+ xmlXPathContextPtr ctxt,
|
|
|
0a7476 |
+ xmlNodePtr node,
|
|
|
0a7476 |
+ unsigned int flags)
|
|
|
0a7476 |
+{
|
|
|
0a7476 |
+ xmlNodePtr oldnode = ctxt->node;
|
|
|
0a7476 |
+ xmlNodePtr *nodes = NULL;
|
|
|
0a7476 |
+ virBitmapPtr vcpus = NULL;
|
|
|
0a7476 |
+ virResctrlAllocPtr alloc = NULL;
|
|
|
0a7476 |
+ ssize_t i = 0;
|
|
|
0a7476 |
+ int n;
|
|
|
0a7476 |
+ int ret = -1;
|
|
|
0a7476 |
+ bool new_alloc = false;
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ ctxt->node = node;
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ if (virDomainResctrlParseVcpus(def, node, &vcpus) < 0)
|
|
|
0a7476 |
+ goto cleanup;
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ if (virBitmapIsAllClear(vcpus)) {
|
|
|
0a7476 |
+ ret = 0;
|
|
|
0a7476 |
+ goto cleanup;
|
|
|
0a7476 |
+ }
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ if ((n = virXPathNodeSet("./node", ctxt, &nodes)) < 0) {
|
|
|
0a7476 |
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
|
0a7476 |
+ _("Cannot extract memory nodes under memorytune"));
|
|
|
0a7476 |
+ goto cleanup;
|
|
|
0a7476 |
+ }
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ if (virDomainResctrlVcpuMatch(def, vcpus, &alloc) < 0)
|
|
|
0a7476 |
+ goto cleanup;
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ if (!alloc) {
|
|
|
0a7476 |
+ alloc = virResctrlAllocNew();
|
|
|
0a7476 |
+ if (!alloc)
|
|
|
0a7476 |
+ goto cleanup;
|
|
|
0a7476 |
+ new_alloc = true;
|
|
|
0a7476 |
+ } else {
|
|
|
0a7476 |
+ alloc = virObjectRef(alloc);
|
|
|
0a7476 |
+ }
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ for (i = 0; i < n; i++) {
|
|
|
0a7476 |
+ if (virDomainMemorytuneDefParseMemory(ctxt, nodes[i], alloc) < 0)
|
|
|
0a7476 |
+ goto cleanup;
|
|
|
0a7476 |
+ }
|
|
|
0a7476 |
+ if (virResctrlAllocIsEmpty(alloc)) {
|
|
|
0a7476 |
+ ret = 0;
|
|
|
0a7476 |
+ goto cleanup;
|
|
|
0a7476 |
+ }
|
|
|
0a7476 |
+ /*
|
|
|
0a7476 |
+ * If this is a new allocation, format ID and append to resctrl, otherwise
|
|
|
0a7476 |
+ * just update the existing alloc information, which is done in above
|
|
|
0a7476 |
+ * virDomainMemorytuneDefParseMemory */
|
|
|
0a7476 |
+ if (new_alloc) {
|
|
|
0a7476 |
+ if (virDomainResctrlAppend(def, node, alloc, vcpus, flags) < 0)
|
|
|
0a7476 |
+ goto cleanup;
|
|
|
0a7476 |
+ vcpus = NULL;
|
|
|
0a7476 |
+ alloc = NULL;
|
|
|
0a7476 |
+ }
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ ret = 0;
|
|
|
0a7476 |
+ cleanup:
|
|
|
0a7476 |
+ ctxt->node = oldnode;
|
|
|
0a7476 |
+ virObjectUnref(alloc);
|
|
|
0a7476 |
+ virBitmapFree(vcpus);
|
|
|
0a7476 |
+ VIR_FREE(nodes);
|
|
|
0a7476 |
+ return ret;
|
|
|
0a7476 |
+}
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+
|
|
|
0a7476 |
static virDomainDefPtr
|
|
|
0a7476 |
virDomainDefParseXML(xmlDocPtr xml,
|
|
|
0a7476 |
xmlNodePtr root,
|
|
|
0a7476 |
@@ -19856,6 +19979,18 @@ virDomainDefParseXML(xmlDocPtr xml,
|
|
|
0a7476 |
}
|
|
|
0a7476 |
VIR_FREE(nodes);
|
|
|
0a7476 |
|
|
|
0a7476 |
+ if ((n = virXPathNodeSet("./cputune/memorytune", ctxt, &nodes)) < 0) {
|
|
|
0a7476 |
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
|
0a7476 |
+ _("cannot extract memorytune nodes"));
|
|
|
0a7476 |
+ goto error;
|
|
|
0a7476 |
+ }
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ for (i = 0; i < n; i++) {
|
|
|
0a7476 |
+ if (virDomainMemorytuneDefParse(def, ctxt, nodes[i], flags) < 0)
|
|
|
0a7476 |
+ goto error;
|
|
|
0a7476 |
+ }
|
|
|
0a7476 |
+ VIR_FREE(nodes);
|
|
|
0a7476 |
+
|
|
|
0a7476 |
if (virCPUDefParseXML(ctxt, "./cpu[1]", VIR_CPU_TYPE_GUEST, &def->cpu) < 0)
|
|
|
0a7476 |
goto error;
|
|
|
0a7476 |
|
|
|
0a7476 |
@@ -27162,6 +27297,68 @@ virDomainCachetuneDefFormat(virBufferPtr buf,
|
|
|
0a7476 |
}
|
|
|
0a7476 |
|
|
|
0a7476 |
|
|
|
0a7476 |
+static int
|
|
|
0a7476 |
+virDomainMemorytuneDefFormatHelper(unsigned int id,
|
|
|
0a7476 |
+ unsigned int bandwidth,
|
|
|
0a7476 |
+ void *opaque)
|
|
|
0a7476 |
+{
|
|
|
0a7476 |
+ virBufferPtr buf = opaque;
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ virBufferAsprintf(buf,
|
|
|
0a7476 |
+ "<node id='%u' bandwidth='%u'/>\n",
|
|
|
0a7476 |
+ id, bandwidth);
|
|
|
0a7476 |
+ return 0;
|
|
|
0a7476 |
+}
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+static int
|
|
|
0a7476 |
+virDomainMemorytuneDefFormat(virBufferPtr buf,
|
|
|
0a7476 |
+ virDomainResctrlDefPtr resctrl,
|
|
|
0a7476 |
+ unsigned int flags)
|
|
|
0a7476 |
+{
|
|
|
0a7476 |
+ virBuffer childrenBuf = VIR_BUFFER_INITIALIZER;
|
|
|
0a7476 |
+ char *vcpus = NULL;
|
|
|
0a7476 |
+ int ret = -1;
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ virBufferSetChildIndent(&childrenBuf, buf);
|
|
|
0a7476 |
+ if (virResctrlAllocForeachMemory(resctrl->alloc,
|
|
|
0a7476 |
+ virDomainMemorytuneDefFormatHelper,
|
|
|
0a7476 |
+ &childrenBuf) < 0)
|
|
|
0a7476 |
+ goto cleanup;
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ if (virBufferCheckError(&childrenBuf) < 0)
|
|
|
0a7476 |
+ goto cleanup;
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ if (!virBufferUse(&childrenBuf)) {
|
|
|
0a7476 |
+ ret = 0;
|
|
|
0a7476 |
+ goto cleanup;
|
|
|
0a7476 |
+ }
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ vcpus = virBitmapFormat(resctrl->vcpus);
|
|
|
0a7476 |
+ if (!vcpus)
|
|
|
0a7476 |
+ goto cleanup;
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ virBufferAsprintf(buf, "
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ if (!(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE)) {
|
|
|
0a7476 |
+ const char *alloc_id = virResctrlAllocGetID(resctrl->alloc);
|
|
|
0a7476 |
+ if (!alloc_id)
|
|
|
0a7476 |
+ goto cleanup;
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ virBufferAsprintf(buf, " id='%s'", alloc_id);
|
|
|
0a7476 |
+ }
|
|
|
0a7476 |
+ virBufferAddLit(buf, ">\n");
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ virBufferAddBuffer(buf, &childrenBuf);
|
|
|
0a7476 |
+ virBufferAddLit(buf, "</memorytune>\n");
|
|
|
0a7476 |
+
|
|
|
0a7476 |
+ ret = 0;
|
|
|
0a7476 |
+ cleanup:
|
|
|
0a7476 |
+ virBufferFreeAndReset(&childrenBuf);
|
|
|
0a7476 |
+ VIR_FREE(vcpus);
|
|
|
0a7476 |
+ return ret;
|
|
|
0a7476 |
+}
|
|
|
0a7476 |
+
|
|
|
0a7476 |
static int
|
|
|
0a7476 |
virDomainCputuneDefFormat(virBufferPtr buf,
|
|
|
0a7476 |
virDomainDefPtr def,
|
|
|
0a7476 |
@@ -27267,6 +27464,9 @@ virDomainCputuneDefFormat(virBufferPtr buf,
|
|
|
0a7476 |
for (i = 0; i < def->nresctrls; i++)
|
|
|
0a7476 |
virDomainCachetuneDefFormat(&childrenBuf, def->resctrls[i], flags);
|
|
|
0a7476 |
|
|
|
0a7476 |
+ for (i = 0; i < def->nresctrls; i++)
|
|
|
0a7476 |
+ virDomainMemorytuneDefFormat(&childrenBuf, def->resctrls[i], flags);
|
|
|
0a7476 |
+
|
|
|
0a7476 |
if (virBufferCheckError(&childrenBuf) < 0)
|
|
|
0a7476 |
return -1;
|
|
|
0a7476 |
|
|
|
0a7476 |
diff --git a/tests/genericxml2xmlindata/memorytune-colliding-allocs.xml b/tests/genericxml2xmlindata/memorytune-colliding-allocs.xml
|
|
|
0a7476 |
new file mode 100644
|
|
|
0a7476 |
index 0000000000..9b8ebaa084
|
|
|
0a7476 |
--- /dev/null
|
|
|
0a7476 |
+++ b/tests/genericxml2xmlindata/memorytune-colliding-allocs.xml
|
|
|
0a7476 |
@@ -0,0 +1,30 @@
|
|
|
0a7476 |
+<domain type='qemu'>
|
|
|
0a7476 |
+ <name>QEMUGuest1</name>
|
|
|
0a7476 |
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
|
|
0a7476 |
+ <memory unit='KiB'>219136</memory>
|
|
|
0a7476 |
+ <currentMemory unit='KiB'>219136</currentMemory>
|
|
|
0a7476 |
+ <vcpu placement='static'>4</vcpu>
|
|
|
0a7476 |
+ <cputune>
|
|
|
0a7476 |
+ <memorytune vcpus='0'>
|
|
|
0a7476 |
+ <node id='0' bandwidth='50'/>
|
|
|
0a7476 |
+ <node id='0' bandwidth='50'/>
|
|
|
0a7476 |
+ </memorytune>
|
|
|
0a7476 |
+ </cputune>
|
|
|
0a7476 |
+ <os>
|
|
|
0a7476 |
+ <type arch='i686' machine='pc'>hvm</type>
|
|
|
0a7476 |
+ <boot dev='hd'/>
|
|
|
0a7476 |
+ </os>
|
|
|
0a7476 |
+ <clock offset='utc'/>
|
|
|
0a7476 |
+ <on_poweroff>destroy</on_poweroff>
|
|
|
0a7476 |
+ <on_reboot>restart</on_reboot>
|
|
|
0a7476 |
+ <on_crash>destroy</on_crash>
|
|
|
0a7476 |
+ <devices>
|
|
|
0a7476 |
+ <emulator>/usr/bin/qemu-system-i686</emulator>
|
|
|
0a7476 |
+ <controller type='usb' index='0'/>
|
|
|
0a7476 |
+ <controller type='ide' index='0'/>
|
|
|
0a7476 |
+ <controller type='pci' index='0' model='pci-root'/>
|
|
|
0a7476 |
+ <input type='mouse' bus='ps2'/>
|
|
|
0a7476 |
+ <input type='keyboard' bus='ps2'/>
|
|
|
0a7476 |
+ <memballoon model='virtio'/>
|
|
|
0a7476 |
+ </devices>
|
|
|
0a7476 |
+</domain>
|
|
|
0a7476 |
diff --git a/tests/genericxml2xmlindata/memorytune-colliding-cachetune.xml b/tests/genericxml2xmlindata/memorytune-colliding-cachetune.xml
|
|
|
0a7476 |
new file mode 100644
|
|
|
0a7476 |
index 0000000000..5416870de2
|
|
|
0a7476 |
--- /dev/null
|
|
|
0a7476 |
+++ b/tests/genericxml2xmlindata/memorytune-colliding-cachetune.xml
|
|
|
0a7476 |
@@ -0,0 +1,32 @@
|
|
|
0a7476 |
+<domain type='qemu'>
|
|
|
0a7476 |
+ <name>QEMUGuest1</name>
|
|
|
0a7476 |
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
|
|
0a7476 |
+ <memory unit='KiB'>219136</memory>
|
|
|
0a7476 |
+ <currentMemory unit='KiB'>219136</currentMemory>
|
|
|
0a7476 |
+ <vcpu placement='static'>4</vcpu>
|
|
|
0a7476 |
+ <cputune>
|
|
|
0a7476 |
+ <cachetune vcpus='0-1'>
|
|
|
0a7476 |
+ <cache id='0' level='3' type='code' size='12' unit='KiB'/>
|
|
|
0a7476 |
+ </cachetune>
|
|
|
0a7476 |
+ <memorytune vcpus='0'>
|
|
|
0a7476 |
+ <node id='0' bandwidth='50'/>
|
|
|
0a7476 |
+ </memorytune>
|
|
|
0a7476 |
+ </cputune>
|
|
|
0a7476 |
+ <os>
|
|
|
0a7476 |
+ <type arch='i686' machine='pc'>hvm</type>
|
|
|
0a7476 |
+ <boot dev='hd'/>
|
|
|
0a7476 |
+ </os>
|
|
|
0a7476 |
+ <clock offset='utc'/>
|
|
|
0a7476 |
+ <on_poweroff>destroy</on_poweroff>
|
|
|
0a7476 |
+ <on_reboot>restart</on_reboot>
|
|
|
0a7476 |
+ <on_crash>destroy</on_crash>
|
|
|
0a7476 |
+ <devices>
|
|
|
0a7476 |
+ <emulator>/usr/bin/qemu-system-i686</emulator>
|
|
|
0a7476 |
+ <controller type='usb' index='0'/>
|
|
|
0a7476 |
+ <controller type='ide' index='0'/>
|
|
|
0a7476 |
+ <controller type='pci' index='0' model='pci-root'/>
|
|
|
0a7476 |
+ <input type='mouse' bus='ps2'/>
|
|
|
0a7476 |
+ <input type='keyboard' bus='ps2'/>
|
|
|
0a7476 |
+ <memballoon model='virtio'/>
|
|
|
0a7476 |
+ </devices>
|
|
|
0a7476 |
+</domain>
|
|
|
0a7476 |
diff --git a/tests/genericxml2xmlindata/memorytune.xml b/tests/genericxml2xmlindata/memorytune.xml
|
|
|
0a7476 |
new file mode 100644
|
|
|
0a7476 |
index 0000000000..ea03e22fc2
|
|
|
0a7476 |
--- /dev/null
|
|
|
0a7476 |
+++ b/tests/genericxml2xmlindata/memorytune.xml
|
|
|
0a7476 |
@@ -0,0 +1,33 @@
|
|
|
0a7476 |
+<domain type='qemu'>
|
|
|
0a7476 |
+ <name>QEMUGuest1</name>
|
|
|
0a7476 |
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
|
|
0a7476 |
+ <memory unit='KiB'>219136</memory>
|
|
|
0a7476 |
+ <currentMemory unit='KiB'>219136</currentMemory>
|
|
|
0a7476 |
+ <vcpu placement='static'>4</vcpu>
|
|
|
0a7476 |
+ <cputune>
|
|
|
0a7476 |
+ <memorytune vcpus='0-1'>
|
|
|
0a7476 |
+ <node id='0' bandwidth='20'/>
|
|
|
0a7476 |
+ <node id='1' bandwidth='30'/>
|
|
|
0a7476 |
+ </memorytune>
|
|
|
0a7476 |
+ <memorytune vcpus='3'>
|
|
|
0a7476 |
+ <node id='0' bandwidth='50'/>
|
|
|
0a7476 |
+ </memorytune>
|
|
|
0a7476 |
+ </cputune>
|
|
|
0a7476 |
+ <os>
|
|
|
0a7476 |
+ <type arch='i686' machine='pc'>hvm</type>
|
|
|
0a7476 |
+ <boot dev='hd'/>
|
|
|
0a7476 |
+ </os>
|
|
|
0a7476 |
+ <clock offset='utc'/>
|
|
|
0a7476 |
+ <on_poweroff>destroy</on_poweroff>
|
|
|
0a7476 |
+ <on_reboot>restart</on_reboot>
|
|
|
0a7476 |
+ <on_crash>destroy</on_crash>
|
|
|
0a7476 |
+ <devices>
|
|
|
0a7476 |
+ <emulator>/usr/bin/qemu-system-i686</emulator>
|
|
|
0a7476 |
+ <controller type='usb' index='0'/>
|
|
|
0a7476 |
+ <controller type='ide' index='0'/>
|
|
|
0a7476 |
+ <controller type='pci' index='0' model='pci-root'/>
|
|
|
0a7476 |
+ <input type='mouse' bus='ps2'/>
|
|
|
0a7476 |
+ <input type='keyboard' bus='ps2'/>
|
|
|
0a7476 |
+ <memballoon model='virtio'/>
|
|
|
0a7476 |
+ </devices>
|
|
|
0a7476 |
+</domain>
|
|
|
0a7476 |
diff --git a/tests/genericxml2xmltest.c b/tests/genericxml2xmltest.c
|
|
|
0a7476 |
index 7a4fc1eb7a..e6d4ef2a7f 100644
|
|
|
0a7476 |
--- a/tests/genericxml2xmltest.c
|
|
|
0a7476 |
+++ b/tests/genericxml2xmltest.c
|
|
|
0a7476 |
@@ -140,6 +140,11 @@ mymain(void)
|
|
|
0a7476 |
TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE);
|
|
|
0a7476 |
DO_TEST_FULL("cachetune-colliding-types", false, true,
|
|
|
0a7476 |
TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE);
|
|
|
0a7476 |
+ DO_TEST("memorytune");
|
|
|
0a7476 |
+ DO_TEST_FULL("memorytune-colliding-allocs", false, true,
|
|
|
0a7476 |
+ TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE);
|
|
|
0a7476 |
+ DO_TEST_FULL("memorytune-colliding-cachetune", false, true,
|
|
|
0a7476 |
+ TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE);
|
|
|
0a7476 |
|
|
|
0a7476 |
DO_TEST("tseg");
|
|
|
0a7476 |
|
|
|
0a7476 |
--
|
|
|
0a7476 |
2.21.0
|
|
|
0a7476 |
|