[PATCH 22/24] conf: numa: Add accessor to NUMA node's memory access mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 src/conf/numa_conf.c     | 10 +++++++++-
 src/conf/numa_conf.h     |  2 ++
 src/libvirt_private.syms |  1 +
 src/qemu/qemu_command.c  |  5 +++--
 4 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c
index acda415..4906687 100644
--- a/src/conf/numa_conf.c
+++ b/src/conf/numa_conf.c
@@ -769,7 +769,7 @@ virDomainNumaDefCPUFormat(virBufferPtr buf,
     virBufferAddLit(buf, "<numa>\n");
     virBufferAdjustIndent(buf, 2);
     for (i = 0; i < ncells; i++) {
-        memAccess = def->cells[i].memAccess;
+        memAccess = virDomainNumaGetNodeMemoryAccessMode(def, i);

         if (!(cpustr = virBitmapFormat(virDomainNumaGetNodeCpumask(def, i))))
             return -1;
@@ -832,3 +832,11 @@ virDomainNumaGetNodeCpumask(virCPUDefPtr numa,
 {
     return numa->cells[node].cpumask;
 }
+
+
+virNumaMemAccess
+virDomainNumaGetNodeMemoryAccessMode(virCPUDefPtr numa,
+                                     size_t node)
+{
+    return numa->cells[node].memAccess;
+}
diff --git a/src/conf/numa_conf.h b/src/conf/numa_conf.h
index ab88ab7..0ea2c93 100644
--- a/src/conf/numa_conf.h
+++ b/src/conf/numa_conf.h
@@ -89,6 +89,8 @@ int virDomainNumatuneMaybeGetNodeset(virDomainNumaPtr numatune,
 size_t virDomainNumaGetNodeCount(virCPUDefPtr numa);
 virBitmapPtr virDomainNumaGetNodeCpumask(virCPUDefPtr numa,
                                          size_t node);
+virNumaMemAccess virDomainNumaGetNodeMemoryAccessMode(virCPUDefPtr numa,
+                                                      size_t node);

 /*
  * Formatters
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 770803b..1f1ce14 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -631,6 +631,7 @@ virDomainNumaEquals;
 virDomainNumaFree;
 virDomainNumaGetNodeCount;
 virDomainNumaGetNodeCpumask;
+virDomainNumaGetNodeMemoryAccessMode;
 virDomainNumaNew;
 virDomainNumatuneFormatNodeset;
 virDomainNumatuneFormatXML;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index d276da3..05545ee 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4558,7 +4558,8 @@ qemuBuildMemoryBackendStr(unsigned long long size,
     virDomainHugePagePtr hugepage = NULL;
     virDomainNumatuneMemMode mode;
     const long system_page_size = virGetSystemPageSizeKB();
-    virNumaMemAccess memAccess = def->cpu->cells[guestNode].memAccess;
+    virNumaMemAccess memAccess = virDomainNumaGetNodeMemoryAccessMode(def->cpu, guestNode);
+
     size_t i;
     char *mem_path = NULL;
     virBitmapPtr nodemask = NULL;
@@ -7185,7 +7186,7 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg,
             if (rc == 0)
                 needBackend = true;
         } else {
-            if (def->cpu->cells[i].memAccess) {
+            if (virDomainNumaGetNodeMemoryAccessMode(def->cpu, i)) {
                 virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                                _("Shared memory mapping is not supported "
                                  "with this QEMU"));
-- 
2.2.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]