From nobody Mon Mar 23 23:30:08 2026 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=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1773074936; cv=none; d=zohomail.com; s=zohoarc; b=du1qe8weqmf8lx7+7JB1ehn9tw5OAzpNcbFpazOijdBeucxGToz4YvFiQbnJQje/dlK97170l5Eq5FTiu8pd6WjW2zWsc0FU/AZZkRyvVzY5ALr20rBRaEQmO91WwDx05jxi/6CbOIKgpIxVi3CJIzZ4/NHcMRqXAesXatt7mM0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773074936; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Subject:Subject:To:To:Message-Id:Cc; bh=lBULb3T9uAdTtpEFVD8E6f7l8FaGLXYnozl7hL7WJ6A=; b=SUDlTDuvlKOfG6vGKzC9H8nTpHEowtZk+HpAkY3G3DCSAwn0isJmQCmcj5TRdqn7fI/jT0p5i2Kl9hA5iDxlgzMi43Ce2/zf47Wt/TMEHovS75p5MKZ7rMU+sLwhcMwiLCJZ7Nxd3LaprzZunnKabflAKi2PdG8F8rWYGrOCXog= ARC-Authentication-Results: i=1; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1773074936790260.8347934033425; Mon, 9 Mar 2026 09:48:56 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 1FD734180E; Mon, 9 Mar 2026 12:48:56 -0400 (EDT) Received: from [172.19.199.12] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id C8D9841989; Mon, 9 Mar 2026 12:48:22 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 6F9E43F95B; Mon, 9 Mar 2026 12:48:18 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 4AA843F896 for ; Mon, 9 Mar 2026 12:48:17 -0400 (EDT) Received: from mx-prod-mc-01.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-530-xBsbNqNIO1KiHjFdiDoedg-1; Mon, 09 Mar 2026 12:48:15 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id ACAAF19560A7 for ; Mon, 9 Mar 2026 16:48:14 +0000 (UTC) Received: from speedmetal.openshiftapps.com (unknown [10.45.242.5]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F2B11300019F for ; Mon, 9 Mar 2026 16:48:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HELO_MISC_IP,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773074897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lBULb3T9uAdTtpEFVD8E6f7l8FaGLXYnozl7hL7WJ6A=; b=KQ1BYxeureP/vtuzw78ajdQW0M0/ejDx6ok0hPFagVoxweeXa7WyXPHefB00/6gwzeTHCi rWjqX/3J4UVjBFD2xoP4G1HFP3VyytV2jvqxYuMYb/hdGcBEnaGOXcMx8Bi9+ySGZyRA+q TJnLFfVjjt+Cxh0TTirMeGYz4D42fFA= X-MC-Unique: xBsbNqNIO1KiHjFdiDoedg-1 X-Mimecast-MFC-AGG-ID: xBsbNqNIO1KiHjFdiDoedg_1773074894 To: devel@lists.libvirt.org Subject: [PATCH] util: Move 'virProcessLimitResourceToLabel' into same preprocessor if-block as only caller Date: Mon, 9 Mar 2026 17:48:12 +0100 Message-ID: <16e8d39a6ab9e29be3a965fb0a16ab5fd169802c.1773074892.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 0FaqiqYBsyw4NGFVbz4lqLzwVHk2bZNv_1EHF6LkjaM_1773074894 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: SGDLFKNJHBUCGW5BPE6M3Y5BTCZQMW3Y X-Message-ID-Hash: SGDLFKNJHBUCGW5BPE6M3Y5BTCZQMW3Y X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1773074938927154100 Content-Type: text/plain; charset="utf-8" From: Peter Krempa 'virProcessLimitResourceToLabel' is called only from 'virProcessGetLimitFromProc' but the latter has different conditions when it's compiled. In certain cases this could lead to build failures. Fixes: 90fe839f8a0 Closes: https://gitlab.com/libvirt/libvirt/-/work_items/848 Signed-off-by: Peter Krempa Reviewed-by: Roman Bogorodskiy --- src/util/virprocess.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/util/virprocess.c b/src/util/virprocess.c index e8120c1bdc..e06ed94b0d 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -743,36 +743,36 @@ virProcessPrLimit(pid_t pid G_GNUC_UNUSED, #endif #if WITH_GETRLIMIT +# if defined(__linux__) static const char* virProcessLimitResourceToLabel(int resource) { switch (resource) { -# if defined(RLIMIT_MEMLOCK) +# if defined(RLIMIT_MEMLOCK) case RLIMIT_MEMLOCK: return "Max locked memory"; -# endif /* defined(RLIMIT_MEMLOCK) */ +# endif /* defined(RLIMIT_MEMLOCK) */ -# if defined(RLIMIT_NPROC) +# if defined(RLIMIT_NPROC) case RLIMIT_NPROC: return "Max processes"; -# endif /* defined(RLIMIT_NPROC) */ +# endif /* defined(RLIMIT_NPROC) */ -# if defined(RLIMIT_NOFILE) +# if defined(RLIMIT_NOFILE) case RLIMIT_NOFILE: return "Max open files"; -# endif /* defined(RLIMIT_NOFILE) */ +# endif /* defined(RLIMIT_NOFILE) */ -# if defined(RLIMIT_CORE) +# if defined(RLIMIT_CORE) case RLIMIT_CORE: return "Max core file size"; -# endif /* defined(RLIMIT_CORE) */ +# endif /* defined(RLIMIT_CORE) */ default: return NULL; } } -# if defined(__linux__) static int virProcessGetLimitFromProc(pid_t pid, int resource, --=20 2.53.0