From nobody Tue Jan 21 04:15:57 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 173626715879532.135969648392916; Tue, 7 Jan 2025 08:25:58 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id CEDF5DC6; Tue, 7 Jan 2025 11:25:57 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id E45D3DB5; Tue, 7 Jan 2025 11:25:41 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 4289BA58; Tue, 7 Jan 2025 11:25:38 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 89B0CB6E for ; Tue, 7 Jan 2025 11:25:36 -0500 (EST) Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-192-ONzdr02ZOZ6IIexhln6rZw-1; Tue, 07 Jan 2025 11:25:35 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 39C9C1944EBF for ; Tue, 7 Jan 2025 16:25:31 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.64]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A40811955E9E; Tue, 7 Jan 2025 16:25:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736267136; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PIFhf0snxtTWFUzVQXfEwQUdwVhh3U3oAyrTzkSsNAY=; b=C9GqgpeRVlAU0kmI7FM3BWav6O9uXDoHZ6jYfI9333pJv4cXpyLrLw7/X8yCanKBGomB7j 5O6ZHudcC418TuB8M3DScSTlA+YAxyL6WdS5XHBzYLXhxygfohKw15/1Epq1KvR7CfOESR O6PS1WYn6WqQgaaEHBl1d6EcJ12T1iE= X-MC-Unique: ONzdr02ZOZ6IIexhln6rZw-1 X-Mimecast-MFC-AGG-ID: ONzdr02ZOZ6IIexhln6rZw From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: devel@lists.libvirt.org Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH] util: fix off-by-1 in inhibitor constants Date: Tue, 7 Jan 2025 16:25:27 +0000 Message-ID: <20250107162527.637204-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: _fszZyGEaLWY6jlHoO_0dSXlRmO3pCWQOTSkdLUBZE0_1736267133 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 7IMUOOHH7WZA2NUMECGROBRPMMVM2P7X X-Message-ID-Hash: 7IMUOOHH7WZA2NUMECGROBRPMMVM2P7X X-MailFrom: berrange@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1736267160910116600 Content-Type: text/plain; charset="utf-8" The inhibitor constant values were off-by-1, so when converted into string format, we picked the wrong names Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Andrea Bolognani --- src/util/virinhibitor.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/util/virinhibitor.h b/src/util/virinhibitor.h index 0a1c445d41..49cf32fbeb 100644 --- a/src/util/virinhibitor.h +++ b/src/util/virinhibitor.h @@ -26,13 +26,13 @@ typedef struct _virInhibitor virInhibitor; =20 typedef enum { VIR_INHIBITOR_WHAT_NONE =3D 0, - VIR_INHIBITOR_WHAT_SLEEP =3D (1 << 1), - VIR_INHIBITOR_WHAT_SHUTDOWN =3D (1 << 2), - VIR_INHIBITOR_WHAT_IDLE =3D (1 << 3), - VIR_INHIBITOR_WHAT_POWER_KEY =3D (1 << 4), - VIR_INHIBITOR_WHAT_SUSPEND_KEY =3D (1 << 5), - VIR_INHIBITOR_WHAT_HIBERNATE_KEY =3D (1 << 6), - VIR_INHIBITOR_WHAT_LID_SWITCH =3D (1 << 7), + VIR_INHIBITOR_WHAT_SLEEP =3D (1 << 0), + VIR_INHIBITOR_WHAT_SHUTDOWN =3D (1 << 1), + VIR_INHIBITOR_WHAT_IDLE =3D (1 << 2), + VIR_INHIBITOR_WHAT_POWER_KEY =3D (1 << 3), + VIR_INHIBITOR_WHAT_SUSPEND_KEY =3D (1 << 4), + VIR_INHIBITOR_WHAT_HIBERNATE_KEY =3D (1 << 5), + VIR_INHIBITOR_WHAT_LID_SWITCH =3D (1 << 6), } virInhibitorWhat; =20 typedef enum { --=20 2.47.1