mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
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:
parent
b43acd8e82
commit
09c12ba248
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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++) {
|
||||
|
Loading…
Reference in New Issue
Block a user