]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu_process: Enable SCHED_CORE for QEMU process
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 11 Aug 2022 09:57:54 +0000 (11:57 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 20 Oct 2022 06:59:15 +0000 (08:59 +0200)
For QEMU_SCHED_CORE_EMULATOR or QEMU_SCHED_CORE_FULL the QEMU
process (and its vCPU threads) should be placed into its own
scheduling group. Since we have the dummy process running for
exactly this purpose use its PID as an argument to
virCommandSetRunAmong().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/qemu/qemu_process.c

index 691bbd0edd8eac68bbbc12349f32f489beb9bdec..d55686afd1d2ff56319e14fd051e07facb28073b 100644 (file)
@@ -7533,6 +7533,9 @@ qemuProcessLaunch(virConnectPtr conn,
         virCommandSetMaxProcesses(cmd, cfg->maxProcesses);
     if (cfg->maxFiles > 0)
         virCommandSetMaxFiles(cmd, cfg->maxFiles);
+    if (cfg->schedCore == QEMU_SCHED_CORE_EMULATOR ||
+        cfg->schedCore == QEMU_SCHED_CORE_FULL)
+        virCommandSetRunAmong(cmd, priv->schedCoreChildPID);
 
     /* In this case, however, zero means that core dumps should be
      * disabled, and so we always need to set the limit explicitly */