---
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