]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuDomainPinIOThread: Update live definition after process pinning
authorPeter Krempa <pkrempa@redhat.com>
Tue, 18 Jan 2022 09:08:03 +0000 (10:08 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 18 Jan 2022 13:16:48 +0000 (14:16 +0100)
Otherwise we'll keep using the new pinning value even if it can't be
applied to the thread.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2040555
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/qemu/qemu_driver.c

index 077547e1d33c5b52a51d26978c522118bfba83df..3c0c81a6b982a5e1b4085ba568389309c069e6b2 100644 (file)
@@ -5018,10 +5018,6 @@ qemuDomainPinIOThread(virDomainPtr dom,
             goto endjob;
         }
 
-        virBitmapFree(iothrid->cpumask);
-        iothrid->cpumask = virBitmapNewCopy(pcpumap);
-        iothrid->autofill = false;
-
         /* Configure the corresponding cpuset cgroup before set affinity. */
         if (virCgroupHasController(priv->cgroup,
                                    VIR_CGROUP_CONTROLLER_CPUSET)) {
@@ -5039,6 +5035,10 @@ qemuDomainPinIOThread(virDomainPtr dom,
         if (virProcessSetAffinity(iothrid->thread_id, pcpumap, false) < 0)
             goto endjob;
 
+        virBitmapFree(iothrid->cpumask);
+        iothrid->cpumask = virBitmapNewCopy(pcpumap);
+        iothrid->autofill = false;
+
         qemuDomainSaveStatus(vm);
 
         if (g_snprintf(paramField, VIR_TYPED_PARAM_FIELD_LENGTH,