[PATCH 16/27] qemu: setcpus: Move NUMA setup code into the block checking live def

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

 



---
 src/qemu/qemu_driver.c | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index dd6cfe0..3e37f7e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4814,6 +4814,23 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
                            nvcpus, virDomainDefGetVcpusMax(def));
             goto endjob;
         }
+
+        if (virNumaIsAvailable() &&
+            virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET)) {
+            if (virCgroupNewThread(priv->cgroup, VIR_CGROUP_THREAD_EMULATOR, 0,
+                                   false, &cgroup_temp) < 0)
+                goto endjob;
+
+            if (!(all_nodes = virNumaGetHostNodeset()))
+                goto endjob;
+
+            if (!(all_nodes_str = virBitmapFormat(all_nodes)))
+                goto endjob;
+
+            if (virCgroupGetCpusetMems(cgroup_temp, &mem_mask) < 0 ||
+                virCgroupSetCpusetMems(cgroup_temp, all_nodes_str) < 0)
+                goto endjob;
+        }
     }

     if (persistentDef) {
@@ -4827,23 +4844,6 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
         }
     }

-    if (def && virNumaIsAvailable() &&
-        virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET)) {
-        if (virCgroupNewThread(priv->cgroup, VIR_CGROUP_THREAD_EMULATOR, 0,
-                               false, &cgroup_temp) < 0)
-            goto endjob;
-
-        if (!(all_nodes = virNumaGetHostNodeset()))
-            goto endjob;
-
-        if (!(all_nodes_str = virBitmapFormat(all_nodes)))
-            goto endjob;
-
-        if (virCgroupGetCpusetMems(cgroup_temp, &mem_mask) < 0 ||
-            virCgroupSetCpusetMems(cgroup_temp, all_nodes_str) < 0)
-            goto endjob;
-    }
-
     if (def) {
         if (nvcpus > virDomainDefGetVcpus(def)) {
             for (i = virDomainDefGetVcpus(def); i < nvcpus; i++) {
-- 
2.9.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]