From f7e1a546f274658fc03a87a84c40c005c098b47c Mon Sep 17 00:00:00 2001 From: Hu Tao Date: Thu, 6 Sep 2012 18:13:52 +0800 Subject: [PATCH] fix bug in qemuSetupCgroupForEmulator Should not return 0 when failed to setup cgroup. --- src/qemu/qemu_cgroup.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index 5b4279302f..71558c3a1b 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -691,13 +691,17 @@ int qemuSetupCgroupForEmulator(struct qemud_driver *driver, } if (def->cputune.emulatorpin && - qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPUSET) && - qemuSetupCgroupEmulatorPin(cgroup_emulator, def->cputune.emulatorpin) < 0) - goto cleanup; + qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPUSET)) { + rc = qemuSetupCgroupEmulatorPin(cgroup_emulator, + def->cputune.emulatorpin); + if (rc < 0) + goto cleanup; + } if (period || quota) { if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPU)) { - if (qemuSetupCgroupVcpuBW(cgroup_emulator, period, quota) < 0) + if ((rc = qemuSetupCgroupVcpuBW(cgroup_emulator, period, + quota)) < 0) goto cleanup; } } -- GitLab