From nobody Sun Feb 8 05:40:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1687354471; cv=none; d=zohomail.com; s=zohoarc; b=XuV+HP3m9/IvYB5PqBD31acHP2s4LU534R67Pu7Xr/GNnhp0/1uA7qx03oPeOfsOj5G1laJaKjxHUX1XbGjOOQUZmlkOHdv5T2tJOrem2bBDnVfzqcUSSbNqJz/A2GXwCfiCJxD43fyV2OV/Mw//zGxIQJkUl12Qst4G1WJddUA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687354471; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UnzpqJdjTRoPAvMFJXJ5Fjz9CpPXmErOhKYtnO6uhTM=; b=b6JRNa+Vw5Y71RihbOUdUgpc95tcbX4qypS9SbnMb4fQcXTanc8bArtVQ7vsDwjuMM6jfsDbEd4DRpfQXKKiNiVgL2PlHuK7ACD8BnHpgjK9nfVVQced8AiO1byq1EMIE/dGtHdzb3bip1n2dJJmswl6Mz759RxOKqnJCGZZA5U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1687354471417624.0120320525798; Wed, 21 Jun 2023 06:34:31 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-583-yzhDVOctMVuBjnWHhCXnLw-1; Wed, 21 Jun 2023 09:34:20 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 08F093C1C4D4; Wed, 21 Jun 2023 13:33:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB8E3492B01; Wed, 21 Jun 2023 13:33:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D39E01946587; Wed, 21 Jun 2023 13:33:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6D4EB1946586 for ; Wed, 21 Jun 2023 13:32:36 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 5D9DF425357; Wed, 21 Jun 2023 13:32:36 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.42.28.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id EF4E240D1A4; Wed, 21 Jun 2023 13:32:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687354470; h=from:from:sender:sender: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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=UnzpqJdjTRoPAvMFJXJ5Fjz9CpPXmErOhKYtnO6uhTM=; b=Kw2hq8sduZFz336DjhGOFOz8+OK2eKD44U2BSbmSaHjiH/HJHauy/bpqWtiSq40NVVzt9X il14Ql5Vrp0ppeLKuXB6S4FQs4RNfWvilU4D7NN5P/jWJGLAkQjhCAd5sPR6aNov8IF8I8 asOQl2uNj58QSAfAxVtmz4X7vJMNXnE= X-MC-Unique: yzhDVOctMVuBjnWHhCXnLw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 3/9] util: remove pointless wrappers for setrlimit/getrlimit Date: Wed, 21 Jun 2023 14:32:26 +0100 Message-Id: <20230621133232.4156333-4-berrange@redhat.com> In-Reply-To: <20230621133232.4156333-1-berrange@redhat.com> References: <20230621133232.4156333-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1687354471793100001 These wrappers added no semantic difference over calling the system function directly. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Peter Krempa --- src/util/virprocess.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/util/virprocess.c b/src/util/virprocess.c index 2fd9b406a1..0462ae8465 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -736,24 +736,6 @@ virProcessPrLimit(pid_t pid G_GNUC_UNUSED, } #endif =20 -#if WITH_GETRLIMIT -static int -virProcessGetRLimit(int resource, - struct rlimit *old_limit) -{ - return getrlimit(resource, old_limit); -} -#endif /* WITH_GETRLIMIT */ - -#if WITH_SETRLIMIT -static int -virProcessSetRLimit(int resource, - const struct rlimit *new_limit) -{ - return setrlimit(resource, new_limit); -} -#endif /* WITH_SETRLIMIT */ - #if WITH_GETRLIMIT static const char* virProcessLimitResourceToLabel(int resource) @@ -876,7 +858,7 @@ virProcessGetLimit(pid_t pid, if (virProcessGetLimitFromProc(pid, resource, old_limit) =3D=3D 0) return 0; =20 - if (same_process && virProcessGetRLimit(resource, old_limit) =3D=3D 0) + if (same_process && getrlimit(resource, old_limit) =3D=3D 0) return 0; =20 return -1; @@ -895,7 +877,7 @@ virProcessSetLimit(pid_t pid, if (virProcessPrLimit(pid, resource, new_limit, NULL) =3D=3D 0) return 0; =20 - if (same_process && virProcessSetRLimit(resource, new_limit) =3D=3D 0) + if (same_process && setrlimit(resource, new_limit) =3D=3D 0) return 0; =20 return -1; --=20 2.40.1