From nobody Tue May 7 04:20:12 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=1562231156; cv=none; d=zoho.com; s=zohoarc; b=fgZRMZbmBIfvkKrnI5GXMuqCSMnh/rSA0HmxyTk3HRggsZ/oY5/7cxSo9iZGwho3IT86jf1tD2UyDRYyMnD/qNuFcdPlMUNp+YBPhw1Nn7g6mK+lH8PtvLIS+mnzXrXWGOSVbbfCQsKK426xNsXJ2THvtNZgBi0U+sFFAFxEyP8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562231156; 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=GfsvdOYthUBbGtumAlJUG+0Jcal3CtqZbYQlPZzBIgg=; b=XTWh/PUMkSw9PDgSHHxOtUSBmInOUC6aPchrgatchrtNB+QEt8d13jnnIyyE1LLkRUFONyjgk0TwVL8Fq5kOf12FrXGcbNa9gFgktKZSvm6etgvguhvN79lpmgsXUZI4DoryHlMgvLgolDb+FF8Nk7JqMS8VGjAKiDsnkjLAA5U= 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 1562231156615578.621806861254; Thu, 4 Jul 2019 02:05:56 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DE7593086209; Thu, 4 Jul 2019 09:05:32 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 07F731868A; Thu, 4 Jul 2019 09:05:27 +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 387DC1833002; Thu, 4 Jul 2019 09:05:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x64959wu003785 for ; Thu, 4 Jul 2019 05:05:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id CBA676012E; Thu, 4 Jul 2019 09:05:09 +0000 (UTC) Received: from mx1.redhat.com (ext-mx17.extmail.prod.ext.phx2.redhat.com [10.5.110.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C68252B58F for ; Thu, 4 Jul 2019 09:05:05 +0000 (UTC) Received: from shell.v3.sk (shell.v3.sk [90.176.6.54]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DAAD830C5854 for ; Thu, 4 Jul 2019 09:04:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 705E9CE754 for ; Thu, 4 Jul 2019 11:04:26 +0200 (CEST) Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id w2_Ye0mWDMVu; Thu, 4 Jul 2019 11:04:22 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 8F394CE76C; Thu, 4 Jul 2019 11:04:22 +0200 (CEST) Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id N0Xe_V2Mgwr7; Thu, 4 Jul 2019 11:04:21 +0200 (CEST) Received: from belphegor.brq.redhat.com (nat-pool-brq-t.redhat.com [213.175.37.10]) by zimbra.v3.sk (Postfix) with ESMTPSA id 0AC66CE76A; Thu, 4 Jul 2019 11:04:20 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra.v3.sk From: Lubomir Rintel To: libvir-list@redhat.com Date: Thu, 4 Jul 2019 11:04:15 +0200 Message-Id: <20190704090415.538616-1-lkundrak@v3.sk> MIME-Version: 1.0 X-Greylist: Sender passed SPF test, ACL 242 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 04 Jul 2019 09:04:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 04 Jul 2019 09:04:55 +0000 (UTC) for IP:'90.176.6.54' DOMAIN:'shell.v3.sk' HELO:'shell.v3.sk' FROM:'lkundrak@v3.sk' RCPT:'' X-RedHat-Spam-Score: -0.001 (SPF_PASS) 90.176.6.54 shell.v3.sk 90.176.6.54 shell.v3.sk X-Scanned-By: MIMEDefang 2.84 on 10.5.110.46 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Lubomir Rintel Subject: [libvirt] [PATCH] lxc: Fix reboot via initctl 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: , 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Thu, 04 Jul 2019 09:05:45 +0000 (UTC) Content-Type: text/plain; charset="utf-8" virInitctlSetRunLevel() returns 0 only if ended up doing nothing, 1 if it actually succeeded. Let's check for the error condition. Without this, a successful reboot would be treated as a failure and the LXC driver will proceed sending a TERM signal instead, effectively cancelling the shutdown. Signed-off-by: Lubomir Rintel --- src/lxc/lxc_domain.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lxc/lxc_domain.c b/src/lxc/lxc_domain.c index 51a9fd36eb..1dc2d0d4cf 100644 --- a/src/lxc/lxc_domain.c +++ b/src/lxc/lxc_domain.c @@ -457,7 +457,9 @@ lxcDomainInitctlCallback(pid_t pid ATTRIBUTE_UNUSED, data->st[i].st_ino =3D=3D cont_sb.st_ino) continue; =20 - return virInitctlSetRunLevel(fifo, data->runlevel); + if (virInitctlSetRunLevel(fifo, data->runlevel) =3D=3D -1) + return -1; + return 0; } =20 /* If no usable fifo was found then declare success. Caller --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list