diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 90466771cd871ba4a0887f0723b203568e2aed8d..fa5909e9bed3a88d118f27cfa634903db9a9788c 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2658,8 +2658,9 @@ qemuProcessSetupPid(virDomainObjPtr vm, if (use_cpumask && virProcessSetAffinity(pid, use_cpumask) < 0) goto cleanup; - /* Set scheduler type and priority. */ + /* Set scheduler type and priority, but not for the main thread. */ if (sched && + nameval != VIR_CGROUP_THREAD_EMULATOR && virProcessSetScheduler(pid, sched->policy, sched->priority) < 0) goto cleanup; @@ -6773,6 +6774,13 @@ qemuProcessLaunch(virConnectPtr conn, if (qemuProcessSetupIOThreads(vm) < 0) goto cleanup; + VIR_DEBUG("Setting emulator scheduler"); + if (vm->def->cputune.emulatorsched && + virProcessSetScheduler(vm->pid, + vm->def->cputune.emulatorsched->policy, + vm->def->cputune.emulatorsched->priority) < 0) + goto cleanup; + VIR_DEBUG("Setting any required VM passwords"); if (qemuProcessInitPasswords(driver, vm, asyncJob) < 0) goto cleanup;