From nobody Sun Apr 28 09:00:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1563506201; cv=none; d=zoho.com; s=zohoarc; b=f4bnqWz8yg82GWRlqHd+p4yPOdVvvyUA2H2pf0eiTMq1XrA6qhOpLAo1ZdWahGxUeWhpXG7kVtcdcJjPNovMKz40tgaln7m7qeluvWAnprQvIxAEkwBm/dG8wb4PCtOkRqArO4U+PdIKka0PRWzINIgLuf3l5FWKWJr5cEIC41s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563506201; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=ebhKOR5p/8gOHtwDpAB1py3xrn7d84GGYRTpyvf7ZBA=; b=eJjtsFX7T8OGhNjZI25EuIX/CRg0eqpBLHLh86pmTAKptY30X7v5xhwzaUGDt+G4PFUO/vHw7Xek6CF3H1Pw0F/Y6HnjNNz2vrlxYu7eQgbaftOYwz/VcRi3bTqbQfK3tfEwR+yefdOfp8OpgpA276h1e0nMpag7ppjncpX/lYE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1563506200410512.8678089983295; Thu, 18 Jul 2019 20:16:40 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ECA85317916B; Fri, 19 Jul 2019 03:16:37 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4B15B605C6; Fri, 19 Jul 2019 03:16:36 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8B1184E58E; Fri, 19 Jul 2019 03:16:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6J3GUYH014384 for ; Thu, 18 Jul 2019 23:16:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id A15645C236; Fri, 19 Jul 2019 03:16:30 +0000 (UTC) Received: from mx1.redhat.com (ext-mx03.extmail.prod.ext.phx2.redhat.com [10.5.110.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9B5525C3FA for ; Fri, 19 Jul 2019 03:16:28 +0000 (UTC) Received: from mxct.zte.com.cn (out1.zte.com.cn [202.103.147.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1A1D280F7C for ; Fri, 19 Jul 2019 03:16:27 +0000 (UTC) Received: from mse-fl1.zte.com.cn (unknown [10.30.14.238]) by Forcepoint Email with ESMTPS id 5B1F2150EBBB535FF9B4 for ; Fri, 19 Jul 2019 11:16:25 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse-fl1.zte.com.cn with ESMTP id x6J3GE8h017069 for ; Fri, 19 Jul 2019 11:16:14 +0800 (GMT-8) (envelope-from wang.yechao255@zte.com.cn) Received: from kvm-146.localdomain ([10.74.120.146]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019071911164611-2431603 ; Fri, 19 Jul 2019 11:16:46 +0800 From: Wang Yechao To: libvir-list@redhat.com Date: Fri, 19 Jul 2019 11:19:38 +0800 Message-Id: <1563506378-27073-1-git-send-email-wang.yechao255@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-07-19 11:16:46, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-07-19 11:16:20, Serialize complete at 2019-07-19 11:16:20 X-MAIL: mse-fl1.zte.com.cn x6J3GE8h017069 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 19 Jul 2019 03:16:27 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 19 Jul 2019 03:16:27 +0000 (UTC) for IP:'202.103.147.172' DOMAIN:'out1.zte.com.cn' HELO:'mxct.zte.com.cn' FROM:'wang.yechao255@zte.com.cn' RCPT:'' X-RedHat-Spam-Score: -2.3 (RCVD_IN_DNSWL_MED, SPF_HELO_NONE, SPF_PASS) 202.103.147.172 out1.zte.com.cn 202.103.147.172 out1.zte.com.cn X-Scanned-By: MIMEDefang 2.78 on 10.5.110.27 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Wang Yechao , Liu.Jianjun3@zte.com.cn Subject: [libvirt] [PATCH] util: change the return value of virCgroupRemove if failed X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Fri, 19 Jul 2019 03:16:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" virCgroupRemove return -1 when removing cgroup failed. But there are retry code to remove cgroup in QemuProcessStop: retry: if ((ret =3D qemuRemoveCgroup(vm)) < 0) { if (ret =3D=3D -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 --- src/util/vircgroup.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index 268e401..260ed2d 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -2399,11 +2399,13 @@ int virCgroupRemove(virCgroupPtr group) { size_t i; + int ret =3D 0; =20 for (i =3D 0; i < VIR_CGROUP_BACKEND_TYPE_LAST; i++) { - if (group->backends[i] && - group->backends[i]->remove(group) < 0) { - return -1; + if (group->backends[i]) + ret =3D group->backends[i]->remove(group); + if (ret < 0) + return ret; } } =20 --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list