]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Drop @unionMems argument from qemuProcessSetupPid()
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 7 Jun 2023 11:42:10 +0000 (13:42 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 8 Jun 2023 07:39:20 +0000 (09:39 +0200)
The @unionMems argument of qemuProcessSetupPid() function is not
necessary really as all callers pass 'true'. Drop it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/qemu/qemu_process.c

index d9269e37a1db7cb42be827bf7cadd9b423a35875..d3b1bdf6a4fa0ecc3010460fb455c68f9201364a 100644 (file)
@@ -2550,8 +2550,7 @@ qemuProcessSetupPid(virDomainObj *vm,
                     virBitmap *cpumask,
                     unsigned long long period,
                     long long quota,
-                    virDomainThreadSchedParam *sched,
-                    bool unionMems)
+                    virDomainThreadSchedParam *sched)
 {
     qemuDomainObjPrivate *priv = vm->privateData;
     virDomainNuma *numatune = vm->def->numa;
@@ -2591,20 +2590,16 @@ qemuProcessSetupPid(virDomainObj *vm,
     if (virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPU) ||
         virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET)) {
 
-        if (virDomainNumatuneGetMode(numatune, -1, &mem_mode) == 0 &&
-            (mem_mode == VIR_DOMAIN_NUMATUNE_MEM_STRICT ||
-             mem_mode == VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE)) {
-
+        if (virDomainNumatuneGetMode(numatune, -1, &mem_mode) == 0) {
             /* QEMU allocates its memory from the emulator thread. Thus it
              * needs to access union of all host nodes configured. */
-            if (unionMems &&
-                mem_mode != VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE) {
+            if (mem_mode == VIR_DOMAIN_NUMATUNE_MEM_STRICT) {
                 qemuDomainNumatuneMaybeFormatNodesetUnion(vm, NULL, &mem_mask);
-            } else {
-                if (virDomainNumatuneMaybeFormatNodeset(numatune,
-                                                        priv->autoNodeset,
-                                                        &mem_mask, -1) < 0)
-                    goto cleanup;
+            } else if (mem_mode == VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE &&
+                       virDomainNumatuneMaybeFormatNodeset(numatune,
+                                                           priv->autoNodeset,
+                                                           &mem_mask, -1) < 0) {
+                goto cleanup;
             }
         }
 
@@ -2705,8 +2700,7 @@ qemuProcessSetupEmulator(virDomainObj *vm)
                                0, vm->def->cputune.emulatorpin,
                                vm->def->cputune.emulator_period,
                                vm->def->cputune.emulator_quota,
-                               vm->def->cputune.emulatorsched,
-                               true);
+                               vm->def->cputune.emulatorsched);
 }
 
 
@@ -5909,8 +5903,7 @@ qemuProcessSetupVcpu(virDomainObj *vm,
                             vcpuid, vcpu->cpumask,
                             vm->def->cputune.period,
                             vm->def->cputune.quota,
-                            &vcpu->sched,
-                            true) < 0)
+                            &vcpu->sched) < 0)
         return -1;
 
     if (schedCore &&
@@ -6065,8 +6058,7 @@ qemuProcessSetupIOThread(virDomainObj *vm,
                                iothread->cpumask,
                                vm->def->cputune.iothread_period,
                                vm->def->cputune.iothread_quota,
-                               &iothread->sched,
-                               true);
+                               &iothread->sched);
 }