goto cleanup;
}
- if (virCgroupAddTask(priv->cgroup, vm->pid) < 0) {
- virErrorPtr saved = virSaveLastError();
- virCgroupRemove(priv->cgroup);
- virCgroupFree(&priv->cgroup);
- if (saved) {
- virSetError(saved);
- virFreeError(saved);
- }
- goto cleanup;
- }
-
done:
ret = 0;
cleanup:
goto cleanup;
}
+ /* consider the first thread an emulator-thread */
+ if (virCgroupAddTask(cgroup_emulator, vm->pid) < 0)
+ goto cleanup;
+
virCgroupFree(&cgroup_emulator);
return 0;
if (qemuSetupCgroup(driver, vm, nnicindexes, nicindexes) < 0)
goto cleanup;
- /* This must be done after cgroup placement to avoid resetting CPU
- * affinity */
- if (!vm->def->cputune.emulatorpin &&
- qemuProcessInitCpuAffinity(vm) < 0)
- goto cleanup;
-
VIR_DEBUG("Setting domain security labels");
if (virSecurityManagerSetAllLabel(driver->securityManager,
vm->def,
if (qemuSetupCgroupForEmulator(vm) < 0)
goto cleanup;
+ /* This must be done after cgroup placement to avoid resetting CPU
+ * affinity */
+ if (!vm->def->cputune.emulatorpin &&
+ qemuProcessInitCpuAffinity(vm) < 0)
+ goto cleanup;
+
VIR_DEBUG("Setting affinity of emulator threads");
if (qemuProcessSetEmulatorAffinity(vm) < 0)
goto cleanup;