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

[libvirt] [PATCH 7/8] qemu: Prohibit getting the numa parameters if mode is not strict



I don't see any reason to getting the numa parameters if mode is
not strict, as long as setNumaParameters doesn't allow to set
"nodeset" if the mode is not strict, and cpuset.mems only understand
"strict" mode.

Things could be changed if we support to get numa parameters with
libnuma one day, but let's prohibit it now.
---
 src/qemu/qemu_driver.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 5005afa..e60f852 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7828,8 +7828,15 @@ qemuDomainGetNumaParameters(virDomainPtr dom,
 
     if (flags & VIR_DOMAIN_AFFECT_LIVE) {
         if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_MEMORY)) {
-            virReportError(VIR_ERR_OPERATION_INVALID,
-                           "%s", _("cgroup memory controller is not mounted"));
+            virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+                           _("cgroup memory controller is not mounted"));
+            goto cleanup;
+        }
+
+        if (vm->def->numatune.memory.mode != VIR_DOMAIN_NUMATUNE_MEM_STRICT) {
+            virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+                           _("getting numa parameters of running domain is "
+                             "only valid for strict numa mode"));
             goto cleanup;
         }
     }
-- 
1.8.1.4


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