From: Wang Yechao Date: Fri, 19 Jul 2019 03:19:38 +0000 (+0800) Subject: util: change the return value of virCgroupRemove if failed X-Git-Tag: v5.6.0-rc1~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8371307be9c859aeed47d0abd71e241a2e285d6e;p=thirdparty%2Flibvirt.git util: change the return value of virCgroupRemove if failed virCgroupRemove return -1 when removing cgroup failed. But there are retry code to remove cgroup in QemuProcessStop: retry: if ((ret = qemuRemoveCgroup(vm)) < 0) { if (ret == -EBUSY && (retries++ < 5)) { usleep(200*1000); goto retry; } VIR_WARN("Failed to remove cgroup for %s", vm->def->name); } The return value of qemuRemoveCgroup will never be equal to "-EBUSY", so change the return value of virCgroupRemove if failed. Signed-off-by: Wang Yechao Signed-off-by: Michal Privoznik Reviewed-by: Michal Privoznik --- diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index 268e4013e3..f7afc2964d 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -2401,9 +2401,10 @@ virCgroupRemove(virCgroupPtr group) size_t i; for (i = 0; i < VIR_CGROUP_BACKEND_TYPE_LAST; i++) { - if (group->backends[i] && - group->backends[i]->remove(group) < 0) { - return -1; + if (group->backends[i]) { + int rc = group->backends[i]->remove(group); + if (rc < 0) + return rc; } }