From nobody Sun Feb 8 18:32:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) client-ip=63.128.21.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 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=1584980033; cv=none; d=zohomail.com; s=zohoarc; b=A1achMz7mC78Bx9eNowEF1vtFVlgWPtoQfrG83f90LngmjPvKER6/NQm5mRijjI02IU4GGScWkpdjHkyfnQqZLiBNd5lugQyL8KWJuErLyxARbtdX4VnKZNGuAEWPG/0sFt5yx2gjYKGiOZHXDlrXUydYLH7yUHpji0XTmdlkDQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584980033; 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=tCb7AhRvDfRv1GJPSfl6OJvFwI8mpzRqw5RxLsFclTI=; b=POidNyT0STBEv44jdXme8UnrRLrZ65p385Z7B6yTZ5rtL+kYlN38Q4xVQPWwo2I18dfUm25bBj4GlWLVqqHDfup1C01PLyiO047m6cF7O8Ou6K1v+Fly2k5A5+HRBXXM7/kUkypGIe0dAxaCjAlRZ1m5Y5HoWE4HF8+2lf0QPs0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [63.128.21.74]) by mx.zohomail.com with SMTPS id 1584980033572507.0892683799258; Mon, 23 Mar 2020 09:13:53 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-128-iVje9G68Mc2AW6HWq2QZwQ-1; Mon, 23 Mar 2020 12:13:49 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 66998107ACCA; Mon, 23 Mar 2020 16:13:44 +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 361505C28F; Mon, 23 Mar 2020 16:13:44 +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 C701C86386; Mon, 23 Mar 2020 16:13:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 02NGDf07005216 for ; Mon, 23 Mar 2020 12:13:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id C3E379497F; Mon, 23 Mar 2020 16:13:41 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.151]) by smtp.corp.redhat.com (Postfix) with ESMTP id 427D394B30 for ; Mon, 23 Mar 2020 16:13:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584980032; 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=tCb7AhRvDfRv1GJPSfl6OJvFwI8mpzRqw5RxLsFclTI=; b=JxwpwZZPxBMvnFvE8r+SY7jRsCPlKGF768NitrpnMdfVT/O4UgrBUFlq7xRlWUq9EFbcOb pqzqoP6B8YCg5Gmd15811Oop5n9lDXfgF10/RN8OZ3jbKhinPEE6RzcS1dJoup8lScmOYx s8qVYBzXu08N57gMnDeb8aZVBYxkg0E= X-MC-Unique: iVje9G68Mc2AW6HWq2QZwQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH RESEND 2/5] qemuProcessStartManagedPRDaemon: Don't pass -f pidfile to the daemon Date: Mon, 23 Mar 2020 17:13:31 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Now, that our virCommandSetPidFile() is more intelligent we don't need to rely on the daemon to create and lock the pidfile and use virCommandSetPidFile() at the same time. Signed-off-by: Michal Privoznik Reviewed-by: Marc-Andr=C3=A9 Lureau --- src/qemu/qemu_process.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index e8401030a2..0324857913 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2850,7 +2850,6 @@ qemuProcessStartManagedPRDaemon(virDomainObjPtr vm) g_autoptr(virQEMUDriverConfig) cfg =3D NULL; int errfd =3D -1; g_autofree char *pidfile =3D NULL; - int pidfd =3D -1; g_autofree char *socketPath =3D NULL; pid_t cpid =3D -1; g_autoptr(virCommand) cmd =3D NULL; @@ -2869,10 +2868,6 @@ qemuProcessStartManagedPRDaemon(virDomainObjPtr vm) if (!(pidfile =3D qemuProcessBuildPRHelperPidfilePath(vm))) goto cleanup; =20 - /* Just try to acquire. Dummy pid will be replaced later */ - if ((pidfd =3D virPidFileAcquirePath(pidfile, false, -1)) < 0) - goto cleanup; - if (!(socketPath =3D qemuDomainGetManagedPRSocketPath(priv))) goto cleanup; =20 @@ -2887,13 +2882,10 @@ qemuProcessStartManagedPRDaemon(virDomainObjPtr vm) =20 if (!(cmd =3D virCommandNewArgList(cfg->prHelperName, "-k", socketPath, - "-f", pidfile, NULL))) goto cleanup; =20 virCommandDaemonize(cmd); - /* We want our virCommand to write child PID into the pidfile - * so that we can read it even before exec(). */ virCommandSetPidFile(cmd, pidfile); virCommandSetErrorFD(cmd, &errfd); =20 @@ -2956,7 +2948,6 @@ qemuProcessStartManagedPRDaemon(virDomainObjPtr vm) if (pidfile) unlink(pidfile); } - VIR_FORCE_CLOSE(pidfd); VIR_FORCE_CLOSE(errfd); return ret; } --=20 2.24.1