From nobody Sat May 4 10:05:05 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1558627730; cv=none; d=zoho.com; s=zohoarc; b=aylruZwOsFSGJlDI8EwppDE1rina+0IAk0KN3VYfgA0+6yS5OR8/e9Ljhue5Bz/YRlmV34aPcdBcj8anU6NCdpgtxkY82r1Ng2VHEiZxKqgb/gyp25RZNw6NeC4Uy5UELT5R7cskEvY7c1Nm1JFzxH6Fmh8jh2nWbMXUPTtMW8Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558627730; h=Content-Type:Content-Transfer-Encoding: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=YbIXhoCy1dtkTkZ31H7a35KKZEoZVWJ/DbNMP+ZbW1I=; b=TMhBsApbgtQFaipQHNICgauVRZTUbZFXTc95ejTj2d6Od6xLv593ACL5rg302O9E5Xv0+f0ctufFcSeFLIVPhiAGyyDZf/NjMtsN7v42MqUPFT0tSKmhLdE3qBq9xKituY8g+sKrHnnwsXwe8B6KHyyW+E3HBfiFv2z37Qx6LCU= 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1558627730226862.0413171499952; Thu, 23 May 2019 09:08:50 -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 AD59B3002725; Thu, 23 May 2019 16:08:48 +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 867B268389; Thu, 23 May 2019 16:08:47 +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 3EECD1806B18; Thu, 23 May 2019 16:08:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x4NFxXui013487 for ; Thu, 23 May 2019 11:59:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id AE9052E042; Thu, 23 May 2019 15:59:33 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-64.ams2.redhat.com [10.36.112.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE68F2E047; Thu, 23 May 2019 15:59:30 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Thu, 23 May 2019 16:59:28 +0100 Message-Id: <20190523155928.13781-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] nodesuspend: report unsupported if systemd & pm-utils aren't available 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-Type: text/plain; charset="utf-8" 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.46]); Thu, 23 May 2019 16:08:49 +0000 (UTC) When libvirtd is run inside a container it is normal that neither systemd nor pm-utils will be available. In this case there is no way to suspend the host, so libvirt should just report the feature unsupported instead of raising an error. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/util/virnodesuspend.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/util/virnodesuspend.c b/src/util/virnodesuspend.c index 0af0908e4a..3fc5b93ac7 100644 --- a/src/util/virnodesuspend.c +++ b/src/util/virnodesuspend.c @@ -330,11 +330,10 @@ virNodeSuspendSupportsTarget(unsigned int target, boo= l *supported) if (ret =3D=3D -2) ret =3D virNodeSuspendSupportsTargetPMUtils(target, supported); =20 - /* If still unavailable, then report error */ + /* If still unavailable, then report unsupported */ if (ret =3D=3D -2) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Cannot probe for supported suspend types")); - ret =3D -1; + *supported =3D false; + ret =3D 0; } =20 return ret; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list