From nobody Fri Dec 19 04:18:39 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=1678206733; cv=none; d=zohomail.com; s=zohoarc; b=Vfbn2Vf2eoa6IYvDEWeH/zmvwSEzoGys3+gDw9PlkFlxKW8jddzTRIKxFZY4NczlYSJOVHwVhAh1sQAbQROam7z2nVu8MIiZj0aN0pvCrH9c4Wl/hyhgM5lfrKW/5NrT/rdNTj4/trIy5uHTnYKok+W5wJWZt/1UPkrHXJPJDQY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678206733; 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=JjcshGbmNRSBqNDMuxZVHd5yGBJMqOjDF+47uaQxiL8=; b=PteUt+ZWGyhBldxCtiurAlwET4fbIGxBMkXYjhlq4iBNGjUgJULgBd2WXgTp46t/vmXQd+0EN+lYbOH39eY+42+90F1cf/marIuO/B8/cv09cC3oxLk342eIwAclh/MSYjZFedpYt9+jL++Koz3icDFr+HHWyVWhfZbf/uv5us4= 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 1678206733626551.0084264750551; Tue, 7 Mar 2023 08:32:13 -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-249-3BCqBYC1OPe-xCZNtTLy0w-1; Tue, 07 Mar 2023 11:25:22 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AE1F88EF3A3; Tue, 7 Mar 2023 16:16:07 +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 EEEB3C16024; Tue, 7 Mar 2023 16:16:06 +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 9EAEE19466DF; Tue, 7 Mar 2023 16:16:05 +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 AA9C119465A4 for ; Tue, 7 Mar 2023 16:16:04 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 8D3F614171B6; Tue, 7 Mar 2023 16:16:04 +0000 (UTC) Received: from fedora.. (unknown [10.43.2.118]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3491A14171C3 for ; Tue, 7 Mar 2023 16:16:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678206732; 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=JjcshGbmNRSBqNDMuxZVHd5yGBJMqOjDF+47uaQxiL8=; b=MTUopBR3yQn2dty70JOzmuHCsvUqCplEu8NKB3Mt90iOLxxdftt8co9wB1IGWtspiGSw9u aLX3hd8iGUdO97aM9/lUEUyeXPFUBNkm1NDZgEQQVG3kM02xq63lyrm8DK0vO2CgiiBaYV j2vpI51G6xrZxD8F8Mn9RkihGlJ1RxQ= X-MC-Unique: 3BCqBYC1OPe-xCZNtTLy0w-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 1/6] util: remove waitForLock from virPidFileAcquire Date: Tue, 7 Mar 2023 17:15:57 +0100 Message-Id: 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.8 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: 1678206736160100001 The parameter was added for consistency with virPidFileAcquirePath. However, all callers of virPidFileAcquire pass false. Remove the argument. Partially-reverts: 2250a2b5d21c3b3529727f38a99cba22f84024f7 Signed-off-by: J=C3=A1n Tomko --- src/bhyve/bhyve_driver.c | 2 +- src/interface/interface_backend_netcf.c | 2 +- src/interface/interface_backend_udev.c | 2 +- src/libxl/libxl_driver.c | 2 +- src/lxc/lxc_driver.c | 2 +- src/network/bridge_driver.c | 3 +-- src/node_device/node_device_udev.c | 2 +- src/nwfilter/nwfilter_driver.c | 2 +- src/qemu/qemu_driver.c | 2 +- src/secret/secret_driver.c | 2 +- src/storage/storage_driver.c | 3 +-- src/util/virpidfile.c | 3 +-- src/util/virpidfile.h | 1 - src/vz/vz_driver.c | 2 +- 14 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index d100adeb8f..e7d9c2adf3 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -1247,7 +1247,7 @@ bhyveStateInitialize(bool privileged, } =20 if ((bhyve_driver->lockFD =3D - virPidFileAcquire(BHYVE_STATE_DIR, "driver", false, getpid())) < = 0) + virPidFileAcquire(BHYVE_STATE_DIR, "driver", getpid())) < 0) goto cleanup; =20 if (virDomainObjListLoadAllConfigs(bhyve_driver->domains, diff --git a/src/interface/interface_backend_netcf.c b/src/interface/interf= ace_backend_netcf.c index 5964720e0f..7bd3e7e1e2 100644 --- a/src/interface/interface_backend_netcf.c +++ b/src/interface/interface_backend_netcf.c @@ -123,7 +123,7 @@ netcfStateInitialize(bool privileged, } =20 if ((driver->lockFD =3D - virPidFileAcquire(driver->stateDir, "driver", false, getpid())) <= 0) + virPidFileAcquire(driver->stateDir, "driver", getpid())) < 0) goto error; =20 /* open netcf */ diff --git a/src/interface/interface_backend_udev.c b/src/interface/interfa= ce_backend_udev.c index 54b43fb999..cba14f91f8 100644 --- a/src/interface/interface_backend_udev.c +++ b/src/interface/interface_backend_udev.c @@ -1136,7 +1136,7 @@ udevStateInitialize(bool privileged, } =20 if ((driver->lockFD =3D - virPidFileAcquire(driver->stateDir, "driver", false, getpid())) <= 0) + virPidFileAcquire(driver->stateDir, "driver", getpid())) < 0) goto cleanup; =20 driver->udev =3D udev_new(); diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index c8bcde2612..04e74086e6 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -751,7 +751,7 @@ libxlStateInitialize(bool privileged, } =20 if ((libxl_driver->lockFD =3D - virPidFileAcquire(cfg->stateDir, "driver", false, getpid())) < 0) + virPidFileAcquire(cfg->stateDir, "driver", getpid())) < 0) goto error; =20 if (!(libxl_driver->lockManager =3D diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 0f7687a221..b1d53659d7 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -1505,7 +1505,7 @@ static int lxcStateInitialize(bool privileged, } =20 if ((lxc_driver->lockFD =3D - virPidFileAcquire(cfg->stateDir, "driver", false, getpid())) < 0) + virPidFileAcquire(cfg->stateDir, "driver", getpid())) < 0) goto cleanup; =20 /* Get all the running persistent or transient configs first */ diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index a5973e26cd..3fa56bfc09 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -608,8 +608,7 @@ networkStateInitialize(bool privileged, goto error; =20 if ((network_driver->lockFD =3D - virPidFileAcquire(cfg->stateDir, "driver", - false, getpid())) < 0) + virPidFileAcquire(cfg->stateDir, "driver", getpid())) < 0) goto error; =20 /* if this fails now, it will be retried later with networkDnsmasqCaps= Refresh() */ diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_devi= ce_udev.c index 2454cab8f8..5782aa43c8 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -2278,7 +2278,7 @@ nodeStateInitialize(bool privileged, } =20 if ((driver->lockFD =3D - virPidFileAcquire(driver->stateDir, "driver", false, getpid())) <= 0) + virPidFileAcquire(driver->stateDir, "driver", getpid())) < 0) goto cleanup; =20 if (!(driver->devs =3D virNodeDeviceObjListNew()) || diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c index 8e45096eaa..3803850e26 100644 --- a/src/nwfilter/nwfilter_driver.c +++ b/src/nwfilter/nwfilter_driver.c @@ -254,7 +254,7 @@ nwfilterStateInitialize(bool privileged, } =20 if ((driver->lockFD =3D - virPidFileAcquire(driver->stateDir, "driver", false, getpid())) <= 0) + virPidFileAcquire(driver->stateDir, "driver", getpid())) < 0) goto error; =20 if (virNWFilterIPAddrMapInit() < 0) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index c546e35953..fd8136be37 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -678,7 +678,7 @@ qemuStateInitialize(bool privileged, } =20 if ((qemu_driver->lockFD =3D - virPidFileAcquire(cfg->stateDir, "driver", false, getpid())) < 0) + virPidFileAcquire(cfg->stateDir, "driver", getpid())) < 0) goto error; =20 qemu_driver->qemuImgBinary =3D virFindFileInPath("qemu-img"); diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c index c38cd6f651..43d2a0c05a 100644 --- a/src/secret/secret_driver.c +++ b/src/secret/secret_driver.c @@ -536,7 +536,7 @@ secretStateInitialize(bool privileged, } =20 if ((driver->lockFD =3D - virPidFileAcquire(driver->stateDir, "driver", false, getpid())) <= 0) + virPidFileAcquire(driver->stateDir, "driver", getpid())) < 0) goto error; =20 if (!(driver->secrets =3D virSecretObjListNew())) diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index d90c1c9ee8..308704f1c8 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -289,8 +289,7 @@ storageStateInitialize(bool privileged, } =20 if ((driver->lockFD =3D - virPidFileAcquire(driver->stateDir, "driver", - false, getpid())) < 0) + virPidFileAcquire(driver->stateDir, "driver", getpid())) < 0) goto error; =20 if (virStoragePoolObjLoadAllState(driver->pools, diff --git a/src/util/virpidfile.c b/src/util/virpidfile.c index bfd967c1af..5448a8652d 100644 --- a/src/util/virpidfile.c +++ b/src/util/virpidfile.c @@ -447,7 +447,6 @@ int virPidFileAcquirePath(const char *path, =20 int virPidFileAcquire(const char *dir, const char *name, - bool waitForLock, pid_t pid) { g_autofree char *pidfile =3D NULL; @@ -458,7 +457,7 @@ int virPidFileAcquire(const char *dir, if (!(pidfile =3D virPidFileBuildPath(dir, name))) return -ENOMEM; =20 - return virPidFileAcquirePath(pidfile, waitForLock, pid); + return virPidFileAcquirePath(pidfile, false, pid); } =20 =20 diff --git a/src/util/virpidfile.h b/src/util/virpidfile.h index e84542f298..ff4d31c9fd 100644 --- a/src/util/virpidfile.h +++ b/src/util/virpidfile.h @@ -61,7 +61,6 @@ int virPidFileAcquirePath(const char *path, pid_t pid) G_GNUC_WARN_UNUSED_RESULT; int virPidFileAcquire(const char *dir, const char *name, - bool waitForLock, pid_t pid) G_GNUC_WARN_UNUSED_RESULT; =20 int virPidFileReleasePath(const char *path, diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index 327704b375..4a7b14997f 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -4097,7 +4097,7 @@ vzStateInitialize(bool privileged, } =20 if ((vz_driver_lock_fd =3D - virPidFileAcquire(VZ_STATEDIR, "driver", false, getpid())) < 0) + virPidFileAcquire(VZ_STATEDIR, "driver", getpid())) < 0) return VIR_DRV_STATE_INIT_ERROR; =20 if (prlsdkInit() < 0) { --=20 2.39.2