From nobody Sun Feb 8 18:49:30 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1562861178; cv=none; d=zoho.com; s=zohoarc; b=WMjWJWeQWZrBi+wzZny0GA6LcRpCDF250JCLJ+zcLSjE2jZJSAqN9Om2oCU8yIAmGPYmpxUQmLyCQEg/uzLVYFYYHTVEULvLUFKM3VRmKilwLEhnxJRgwY4q5L5BEtpebSFLO7FJyGrGmf6aIccwK7s0pngEddHADMGTz6/4pm4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562861178; 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:ARC-Authentication-Results; bh=BZAk0AiiB2UDUGY/LAnV6yFuocR6Oubo0Qlz+Ic6uMA=; b=kJZf2oRAhvq5kIvnjF0NBmgLKA6W6/tnHNKkn1XuasJ5wetCYUk3oM1knf2mA/v1owd8hBif+SX4iUOfAMtUDzT5usYXKlgck4fKJ81YzXrp84Nitd3XJasDQYlv9pMVBEYwETsAUEEJ5rHZfdfRfKsNw1Hs/RzEDkkEgh2Db1w= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1562861178635826.9546002817706; Thu, 11 Jul 2019 09:06:18 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F3F188112E; Thu, 11 Jul 2019 16:06:16 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CEC721001E74; Thu, 11 Jul 2019 16:06:16 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8AB071972C; Thu, 11 Jul 2019 16:06:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6BG5je6020624 for ; Thu, 11 Jul 2019 12:05:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 473405DD8D; Thu, 11 Jul 2019 16:05:45 +0000 (UTC) Received: from dhcp-17-95.lcy.redhat.com (unknown [10.42.17.95]) by smtp.corp.redhat.com (Postfix) with ESMTP id B63A05D9CC; Thu, 11 Jul 2019 16:05:44 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Thu, 11 Jul 2019 17:05:15 +0100 Message-Id: <20190711160516.2130-29-berrange@redhat.com> In-Reply-To: <20190711160516.2130-1-berrange@redhat.com> References: <20190711160516.2130-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 28/29] all: don't wait for driver lock during startup X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 11 Jul 2019 16:06:17 +0000 (UTC) When the drivers acquire their pidfile lock we don't want to wait if the lock is already held. We need the driver to immediately report error, causing the daemon to exit. Signed-off-by: Daniel P. Berrang=C3=A9 --- 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/leaseshelper.c | 2 +- src/node_device/node_device_hal.c | 2 +- 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/vz/vz_driver.c | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index cfcf4e1fba..5387ac5570 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -1280,7 +1280,7 @@ bhyveStateInitialize(bool privileged, } =20 if ((bhyve_driver->lockFD =3D - virPidFileAcquire(BHYVE_STATE_DIR, "driver", true, getpid())) < 0) + virPidFileAcquire(BHYVE_STATE_DIR, "driver", false, 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 868e49c56e..f575768c4c 100644 --- a/src/interface/interface_backend_netcf.c +++ b/src/interface/interface_backend_netcf.c @@ -120,7 +120,7 @@ netcfStateInitialize(bool privileged, } =20 if ((driver->lockFD =3D - virPidFileAcquire(driver->stateDir, "driver", true, getpid())) < = 0) + virPidFileAcquire(driver->stateDir, "driver", false, 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 fcd7f1c04a..2feaeb95b7 100644 --- a/src/interface/interface_backend_udev.c +++ b/src/interface/interface_backend_udev.c @@ -1199,7 +1199,7 @@ udevStateInitialize(bool privileged, } =20 if ((driver->lockFD =3D - virPidFileAcquire(driver->stateDir, "driver", true, getpid())) < = 0) + virPidFileAcquire(driver->stateDir, "driver", false, 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 a99c7471bb..492028c487 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -747,7 +747,7 @@ libxlStateInitialize(bool privileged, } =20 if ((libxl_driver->lockFD =3D - virPidFileAcquire(cfg->stateDir, "driver", true, getpid())) < 0) + virPidFileAcquire(cfg->stateDir, "driver", false, 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 3982c24f34..d0b6703101 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -1607,7 +1607,7 @@ static int lxcStateInitialize(bool privileged, } =20 if ((lxc_driver->lockFD =3D - virPidFileAcquire(cfg->stateDir, "driver", true, getpid())) < 0) + virPidFileAcquire(cfg->stateDir, "driver", false, getpid())) < 0) goto cleanup; =20 /* Get all the running persistent or transient configs first */ diff --git a/src/network/leaseshelper.c b/src/network/leaseshelper.c index 89d9a003e2..2a10fbf33a 100644 --- a/src/network/leaseshelper.c +++ b/src/network/leaseshelper.c @@ -164,7 +164,7 @@ main(int argc, char **argv) goto cleanup; =20 /* Try to claim the pidfile, exiting if we can't */ - if ((pid_file_fd =3D virPidFileAcquirePath(pid_file, true, getpid())) = < 0) + if ((pid_file_fd =3D virPidFileAcquirePath(pid_file, false, getpid()))= < 0) goto cleanup; =20 /* Since interfaces can be hot plugged, we need to make sure that the diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_devic= e_hal.c index 1920f4566e..1f3f867599 100644 --- a/src/node_device/node_device_hal.c +++ b/src/node_device/node_device_hal.c @@ -637,7 +637,7 @@ nodeStateInitialize(bool privileged ATTRIBUTE_UNUSED, } =20 if ((driver->lockFD =3D - virPidFileAcquire(driver->stateDir, "driver", true, getpid())) < = 0) + virPidFileAcquire(driver->stateDir, "driver", false, getpid())) <= 0) goto failure; =20 if (!(driver->devs =3D virNodeDeviceObjListNew())) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_devi= ce_udev.c index d883462948..8bc63c506c 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1848,7 +1848,7 @@ nodeStateInitialize(bool privileged, } =20 if ((driver->lockFD =3D - virPidFileAcquire(driver->stateDir, "driver", true, getpid())) < = 0) + virPidFileAcquire(driver->stateDir, "driver", false, 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 43561241f6..530e4f5872 100644 --- a/src/nwfilter/nwfilter_driver.c +++ b/src/nwfilter/nwfilter_driver.c @@ -215,7 +215,7 @@ nwfilterStateInitialize(bool privileged, } =20 if ((driver->lockFD =3D - virPidFileAcquire(driver->stateDir, "driver", true, getpid())) < = 0) + virPidFileAcquire(driver->stateDir, "driver", false, getpid())) <= 0) goto error; =20 if (virNWFilterIPAddrMapInit() < 0) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index a52b54b9d8..9793ada367 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -677,7 +677,7 @@ qemuStateInitialize(bool privileged, } =20 if ((qemu_driver->lockFD =3D - virPidFileAcquire(cfg->stateDir, "driver", true, getpid())) < 0) + virPidFileAcquire(cfg->stateDir, "driver", false, 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 9344948db4..0af2bcef96 100644 --- a/src/secret/secret_driver.c +++ b/src/secret/secret_driver.c @@ -504,7 +504,7 @@ secretStateInitialize(bool privileged, } =20 if ((driver->lockFD =3D - virPidFileAcquire(driver->stateDir, "driver", true, getpid())) < = 0) + virPidFileAcquire(driver->stateDir, "driver", false, getpid())) <= 0) goto error; =20 if (!(driver->secrets =3D virSecretObjListNew())) diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index 75430fb0d9..f5d05a7f43 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -4129,7 +4129,7 @@ vzStateInitialize(bool privileged, } =20 if ((vz_driver_lock_fd =3D - virPidFileAcquire(VZ_STATEDIR, "driver", true, getpid())) < 0) + virPidFileAcquire(VZ_STATEDIR, "driver", false, getpid())) < 0) return -1; =20 if (prlsdkInit() < 0) { --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list