From nobody Fri Dec 19 02:51:29 2025 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=1678206661; cv=none; d=zohomail.com; s=zohoarc; b=k1PtvPviMRoGZqoD/T67AkueM1mPIR2SW67/IIAh1STdmBvJMsKlQ4OH0xjGJHlfmjoVLwJElfXDxGfA299poLDjlq9QWF5vmT21BfxusgTAqJ1Z8VIW5eP6WYYh2jqoQ0Qsd7fNvFHpyr7BJWlClnRtuQUZjT+MJOhPPWsrIls= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678206661; 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=Tp57s8fxd5b2KSoDUvF3Zd+9Y9kPGAR9J8m073RHeuI=; b=FCJvkVybZXiAcx0znkjLyi2nnHZFckU9SBSUeHmcwpEG+lzQNoDCWm2oMEsMEjIPyVKVl3lt5fQD1iHHo1ZLxmFWvShF8REtKtCdDFwT+DJ0+Iec413Gyz5YsmCqWWhJJbOuCSfUHI72DKsMTPWPzwWmpd9SfbKfKkzZBPRuI+M= 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 167820666128318.64555249415173; Tue, 7 Mar 2023 08:31:01 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-297-hS07xF5sOtaNWKhyPDsABA-1; Tue, 07 Mar 2023 11:25:24 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 42EFA10A2D84; Tue, 7 Mar 2023 16:16:08 +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 2E623218CC2B; Tue, 7 Mar 2023 16:16:08 +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 26EF51946A6E; Tue, 7 Mar 2023 16:16:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6E8BA19465A4 for ; Tue, 7 Mar 2023 16:16:06 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 51D5314171C3; Tue, 7 Mar 2023 16:16:06 +0000 (UTC) Received: from fedora.. (unknown [10.43.2.118]) by smtp.corp.redhat.com (Postfix) with ESMTP id EE2F914171B6 for ; Tue, 7 Mar 2023 16:16:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678206656; 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=Tp57s8fxd5b2KSoDUvF3Zd+9Y9kPGAR9J8m073RHeuI=; b=AUJ05ds6v25icKb8bHs4UrIurCmMDBfDpbFwZRKVVArc8x2S2D7EZVL/jANzYIJzBf/gEk FL/gF9mORu8BOQaK8YNU6xQeeSwPSWW3fWgs1HsvEUBirSzEJpA2+l2rzYSWVzx2SiriUR w8f8iMpCIzYWMSyy3q7u7SPdNk9mkv0= X-MC-Unique: hS07xF5sOtaNWKhyPDsABA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 4/6] util: virPidFileAcquirePath: remove waitForLock argument Date: Tue, 7 Mar 2023 17:16:00 +0100 Message-Id: <2cd16e2c150fa94eb072057520028b000c63b230.1678205730.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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.6 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: 1678206661789100001 None of the callers need it anymore. Signed-off-by: J=C3=A1n Tomko --- src/locking/lock_daemon.c | 4 ++-- src/logging/log_daemon.c | 4 ++-- src/remote/remote_daemon.c | 2 +- src/util/vircommand.c | 2 +- src/util/virpidfile.c | 7 +++---- src/util/virpidfile.h | 1 - 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c index 5eed6b7c26..6b0a8220e5 100644 --- a/src/locking/lock_daemon.c +++ b/src/locking/lock_daemon.c @@ -648,7 +648,7 @@ virLockDaemonPostExecRestart(const char *state_file, =20 /* Re-claim PID file now as we will not be daemonizing */ if (pid_file && - (*pid_file_fd =3D virPidFileAcquirePath(pid_file, false, getpid())= ) < 0) + (*pid_file_fd =3D virPidFileAcquirePath(pid_file, getpid())) < 0) return -1; =20 if (!(lockDaemon =3D virLockDaemonNewPostExecRestart(object, privilege= d))) @@ -1000,7 +1000,7 @@ int main(int argc, char **argv) { } =20 /* If we have a pidfile set, claim it now, exiting if already take= n */ - if ((pid_file_fd =3D virPidFileAcquirePath(pid_file, false, getpid= ())) < 0) { + if ((pid_file_fd =3D virPidFileAcquirePath(pid_file, getpid())) < = 0) { ret =3D VIR_DAEMON_ERR_PIDFILE; goto cleanup; } diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c index 8025245350..b4db585810 100644 --- a/src/logging/log_daemon.c +++ b/src/logging/log_daemon.c @@ -468,7 +468,7 @@ virLogDaemonPostExecRestart(const char *state_file, =20 /* Re-claim PID file now as we will not be daemonizing */ if (pid_file && - (*pid_file_fd =3D virPidFileAcquirePath(pid_file, false, getpid())= ) < 0) + (*pid_file_fd =3D virPidFileAcquirePath(pid_file, getpid())) < 0) return -1; =20 if (!(logDaemon =3D virLogDaemonNewPostExecRestart(object, @@ -803,7 +803,7 @@ int main(int argc, char **argv) { } =20 /* If we have a pidfile set, claim it now, exiting if already take= n */ - if ((pid_file_fd =3D virPidFileAcquirePath(pid_file, false, getpid= ())) < 0) { + if ((pid_file_fd =3D virPidFileAcquirePath(pid_file, getpid())) < = 0) { ret =3D VIR_DAEMON_ERR_PIDFILE; goto cleanup; } diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c index dd9344168b..4f14187bef 100644 --- a/src/remote/remote_daemon.c +++ b/src/remote/remote_daemon.c @@ -990,7 +990,7 @@ int main(int argc, char **argv) { } =20 /* Try to claim the pidfile, exiting if we can't */ - if ((pid_file_fd =3D virPidFileAcquirePath(pid_file, false, getpid()))= < 0) { + if ((pid_file_fd =3D virPidFileAcquirePath(pid_file, getpid())) < 0) { ret =3D VIR_DAEMON_ERR_PIDFILE; goto cleanup; } diff --git a/src/util/vircommand.c b/src/util/vircommand.c index 0917bc9cfb..1144dfb597 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -828,7 +828,7 @@ virExec(virCommand *cmd) int pidfilefd =3D -1; char c; =20 - pidfilefd =3D virPidFileAcquirePath(cmd->pidfile, false, pid); + pidfilefd =3D virPidFileAcquirePath(cmd->pidfile, pid); if (pidfilefd < 0) goto fork_error; if (virSetInherit(pidfilefd, true) < 0) { diff --git a/src/util/virpidfile.c b/src/util/virpidfile.c index 742531379e..252100cdc3 100644 --- a/src/util/virpidfile.c +++ b/src/util/virpidfile.c @@ -446,10 +446,9 @@ int virPidFileAcquirePathFull(const char *path, =20 =20 int virPidFileAcquirePath(const char *path, - bool waitForLock, pid_t pid) { - return virPidFileAcquirePathFull(path, waitForLock, pid); + return virPidFileAcquirePathFull(path, false, pid); } =20 =20 @@ -465,7 +464,7 @@ int virPidFileAcquire(const char *dir, if (!(pidfile =3D virPidFileBuildPath(dir, name))) return -ENOMEM; =20 - return virPidFileAcquirePath(pidfile, false, pid); + return virPidFileAcquirePath(pidfile, pid); } =20 =20 @@ -566,7 +565,7 @@ virPidFileForceCleanupPathFull(const char *path, bool g= roup) if (virPidFileReadPath(path, &pid) < 0) return -1; =20 - fd =3D virPidFileAcquirePath(path, false, 0); + fd =3D virPidFileAcquirePath(path, 0); if (fd < 0) { virResetLastError(); =20 diff --git a/src/util/virpidfile.h b/src/util/virpidfile.h index 8c70f883be..6db0fb843f 100644 --- a/src/util/virpidfile.h +++ b/src/util/virpidfile.h @@ -60,7 +60,6 @@ int virPidFileAcquirePathFull(const char *path, bool waitForLock, pid_t pid) G_GNUC_WARN_UNUSED_RESULT; int virPidFileAcquirePath(const char *path, - bool waitForLock, pid_t pid) G_GNUC_WARN_UNUSED_RESULT; int virPidFileAcquire(const char *dir, const char *name, --=20 2.39.2