From nobody Sat Feb 7 05:48:47 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1584116956; cv=none; d=zohomail.com; s=zohoarc; b=HSHTSBF0Xn/X+AKXSeXWG3AiNyldQHsy7+gstD/jaXFF8o2QeX+oukBxWKRUcAwafcstAFdtHldQ7NImnpTu4UYmi7AZ+t8vQykQ1E4x8kg4c1qBKp1HA2lI2ztyT8BboC03OnXivbfvHNBHzOtGL1nkKxwXRLZtXI4SKGrN2Zk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584116956; 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=GoOxxniJZ2Yjn+Br4nDS0H+NEasE6nf2Y+PVic1aZKk=; b=EDMwfUbF8Ug4UbngiPq4hWQ/py4IsWXxJJAxBTrlQi+pZzz7/ALDigrVoAinSFPx7BFaATXUyTn0hOKzgEbuALxMIFFEUWZ2rqUxEnd7uiXGSJpdzMznEoNm3IxN++uk0WgejoL2jDWN+IPEvIHolqUjI50cB9w+BqlTaOUVZYg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1584116956617584.460974688875; Fri, 13 Mar 2020 09:29:16 -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-300-HbSscJcUOmOO6BnUWr3wrw-1; Fri, 13 Mar 2020 12:29:12 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 98624800D54; Fri, 13 Mar 2020 16:29:06 +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 1C5F592D20; Fri, 13 Mar 2020 16:29:06 +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 3874385ECD; Fri, 13 Mar 2020 16:29:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 02DGT0op010874 for ; Fri, 13 Mar 2020 12:29:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1A10D1001B34; Fri, 13 Mar 2020 16:29:00 +0000 (UTC) Received: from moe.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 912851001902 for ; Fri, 13 Mar 2020 16:28:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584116955; 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=GoOxxniJZ2Yjn+Br4nDS0H+NEasE6nf2Y+PVic1aZKk=; b=YPNMX0GfXi+Exk1PxCNah4fAH+8tGvTsyCfJOD1rkyUADLp5TZMMGUc1h8ahmsHGepPlKX JN+a115buR9RyzFoUUapF31H+KrnVZ5irfP6gc6iLAC0fSlz0xMmpAINLCh05QvIU3X38Z TweBRtGSfv/8JK+T0a7Pooe/D5M+oA4= X-MC-Unique: HbSscJcUOmOO6BnUWr3wrw-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/5] qemuProcessStartManagedPRDaemon: Don't pass -f pidfile to the daemon Date: Fri, 13 Mar 2020 17:28:50 +0100 Message-Id: <8c51e10f3caa8649a8feec58af79d7f06a7e8bd3.1584116228.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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.15 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 --- 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 31cd553afd..d1170869cf 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2851,7 +2851,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; @@ -2870,10 +2869,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 @@ -2888,13 +2883,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 @@ -2957,7 +2949,6 @@ qemuProcessStartManagedPRDaemon(virDomainObjPtr vm) if (pidfile) unlink(pidfile); } - VIR_FORCE_CLOSE(pidfd); VIR_FORCE_CLOSE(errfd); return ret; } --=20 2.24.1