qemu_dbus: use emulator cgroup for dbus-daemon

All other helper processes are moved to cgroup with QEMU emulator
thread as we keep the root VM cgroup without any processes. This
assumption is validated in qemuRestoreCgroupState() which is called
when libvirtd is restarted and reconnected to all running VMs.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Pavel Hrdina 2020-10-28 03:20:37 +01:00
parent b43acd8e82
commit 09c12ba248
3 changed files with 6 additions and 4 deletions

View File

@ -148,7 +148,8 @@ qemuDBusStop(virQEMUDriverPtr driver,
int
qemuDBusSetupCgroup(virQEMUDriverPtr driver,
virDomainObjPtr vm)
virDomainObjPtr vm,
virCgroupPtr cgroup)
{
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
qemuDomainObjPrivatePtr priv = vm->privateData;
@ -167,7 +168,7 @@ qemuDBusSetupCgroup(virQEMUDriverPtr driver,
return -1;
}
return virCgroupAddProcess(priv->cgroup, cpid);
return virCgroupAddProcess(cgroup, cpid);
}
int

View File

@ -35,4 +35,5 @@ int qemuDBusVMStateAdd(virDomainObjPtr vm, const char *id);
void qemuDBusVMStateRemove(virDomainObjPtr vm, const char *id);
int qemuDBusSetupCgroup(virQEMUDriverPtr driver,
virDomainObjPtr vm);
virDomainObjPtr vm,
virCgroupPtr cgroup);

View File

@ -280,7 +280,7 @@ qemuExtDevicesSetupCgroup(virQEMUDriverPtr driver,
virDomainDefPtr def = vm->def;
size_t i;
if (qemuDBusSetupCgroup(driver, vm) < 0)
if (qemuDBusSetupCgroup(driver, vm, cgroup) < 0)
return -1;
for (i = 0; i < def->nvideos; i++) {