[libvirt] [PATCH 05/10] new numa parameters

Hu Tao hutao at cn.fujitsu.com
Thu Nov 3 11:55:20 UTC 2011


This patch adds two parameters: strict and exclusive that we can
get/set through cpuset.
---
 src/conf/domain_conf.c |   15 +++++++++++++++
 src/conf/domain_conf.h |    2 ++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 0cf3bb7..02a144b 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -6802,6 +6802,10 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
     VIR_FREE(nodes);
 
     /* Extract numatune if exists. */
+
+    def->numatune.strict = 0;
+    def->numatune.exclusive = 0;
+
     if ((n = virXPathNodeSet("./numatune", ctxt, NULL)) < 0) {
         virDomainReportError(VIR_ERR_INTERNAL_ERROR,
                              "%s", _("cannot extract numatune nodes"));
@@ -6829,6 +6833,13 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
                                 "%s", _("nodeset for NUMA memory tuning must be set"));
             goto error;
         }
+
+        if (virXPathNode("./numatune/strict", ctxt)) {
+            def->numatune.strict = 1;
+        }
+        if (virXPathNode("./numatune/exclusive", ctxt)) {
+            def->numatune.exclusive = 1;
+        }
     }
 
     n = virXPathNodeSet("./features/*", ctxt, &nodes);
@@ -10876,6 +10887,10 @@ virDomainDefFormatInternal(virDomainDefPtr def,
 
         virBufferAsprintf(buf, "    <memory nodeset='%s'/>\n", nodemask);
         VIR_FREE(nodemask);
+        if (def->numatune.strict)
+            virBufferAsprintf(buf, "    <strict/>\n");
+        if (def->numatune.exclusive)
+            virBufferAsprintf(buf, "    <exclusive/>\n");
         virBufferAddLit(buf, "  </numatune>\n");
     }
 
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index ca68437..f3dbece 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1355,6 +1355,8 @@ struct _virDomainNumatuneDef {
         char *nodemask;
     } memory;
 
+    int strict;
+    int exclusive;
     /* Future NUMA tuning related stuff should go here. */
 };
 
-- 
1.7.3.1




More information about the libvir-list mailing list