From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTP id 34FF25A005E for ; Thu, 9 Feb 2023 09:48:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675932512; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rFJbQsORd5oAHQzNHfbViRR6pxdA3MKiw3OoTk/RTHA=; b=b5HG/6KQvCjouGY04QTdyoAWb8niOG9Yl77reZB/HuCD6hRjIyoHlzgZM6QKfQtkYvo8KE E1FtspLpmh1Owokq40kI6148c+/g/VqKmlivqEuCt6UR+LhV4NACJFGEsuhx6eXqetNQp9 6GXwXo22In5bwFzSF6XKTX7COnxcv5M= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-186-m1yslAW6PgOPNWUFNygfSw-1; Thu, 09 Feb 2023 03:48:30 -0500 X-MC-Unique: m1yslAW6PgOPNWUFNygfSw-1 Received: by mail-ej1-f69.google.com with SMTP id z2-20020a1709060be200b0088b579825f9so1055031ejg.18 for ; Thu, 09 Feb 2023 00:48:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=rFJbQsORd5oAHQzNHfbViRR6pxdA3MKiw3OoTk/RTHA=; b=2IohIb03bk2kNRWQlmFCZqt+WOBOdjb6H5yQ8mh8stpH2eyp+mUjyDEO+YDYOH0ZLf LpaLHXt6EU8SS9svHy/uZjDEbHPE/ZkHTdg5SnRONWrDRU/N8Xc+e9SLiKJDwBJwL3Ik oTAlLUTb00eE9+UvXf++hHO0r1YDxKzr5jEWXZj5ecltgUrCcFJnEqGeowGJPP0AF2XH gifJbUaR9gdEb1esqPPQJ5XmR/E0dxBA0Gs2OmmvVTbKP7+Qrl64Pc14Ya4EmyMj06iw 7mskj0yqQ4PujhjzYckcqETqUdtlZHhK6S/jusM3kKEXGaYoJy2BNN/z4W26bEfh+n7H BXrA== X-Gm-Message-State: AO0yUKX/uByNaxxoFPe8y/hwPVNA8prwbkQ8tQWXqZ7/Lt1FP9Ae6qI+ wmz7xvxYDFpmi/lrkIMyTjJStQQQy0tD9eIuz8Z5cbA8xGCldEfbZG0CNqKPczN88dTXCqzdP2Y xUPtj4scz8TpmcHfXN7pNO3PVLsdYQYuzFOcNxo9JyMLIC1D2KhSgV/PFL/oBkn5b1s4scgu5 X-Received: by 2002:a50:d492:0:b0:4aa:a4f0:2c17 with SMTP id s18-20020a50d492000000b004aaa4f02c17mr10263620edi.4.1675932509041; Thu, 09 Feb 2023 00:48:29 -0800 (PST) X-Google-Smtp-Source: AK7set/1twUk7+oxWgNXkUDqgEt9rcaZSYLReDZNu4YUdhxxWWmyI2uPhS1aXQE8kfesaIzWc3bnwg== X-Received: by 2002:a50:d492:0:b0:4aa:a4f0:2c17 with SMTP id s18-20020a50d492000000b004aaa4f02c17mr10263601edi.4.1675932508745; Thu, 09 Feb 2023 00:48:28 -0800 (PST) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id u13-20020a50d50d000000b0049e08f781e3sm461509edi.3.2023.02.09.00.48.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Feb 2023 00:48:28 -0800 (PST) Received: by wheatley.localdomain (Postfix, from userid 1000) id DB87BDA130E0; Thu, 9 Feb 2023 09:48:27 +0100 (CET) Date: Thu, 9 Feb 2023 09:48:27 +0100 From: Martin Kletzander To: Laine Stump Subject: Re: [libvirt PATCH] qemu: allow passt to self-daemonize Message-ID: References: <20230208231310.1728051-1-laine@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="yVYfs5J3c3qiv3NL" Content-Disposition: inline In-Reply-To: <20230208231310.1728051-1-laine@redhat.com> X-Clacks-Overhead: GNU Terry Pratchett X-MailFrom: mkletzan@redhat.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation Message-ID-Hash: Q4PCJRDX53QAZOGL24CGMNNU27ZGIP4Q X-Message-ID-Hash: Q4PCJRDX53QAZOGL24CGMNNU27ZGIP4Q X-Mailman-Approved-At: Thu, 09 Feb 2023 10:29:07 +0100 CC: libvir-list@redhat.com, passt-dev@passt.top X-Mailman-Version: 3.3.3 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --yVYfs5J3c3qiv3NL Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline On Wed, Feb 08, 2023 at 06:13:10PM -0500, Laine Stump wrote: >I initially had the passt process being started in an identical >fashion to the slirp-helper - libvirt was daemonizing the new process >and recording its pid in a pidfile. The problem with this is that, >since it is daemonized immediately, any startup error in passt happens >after the daemonization, and thus isn't seen by libvirt - libvirt >believes that the process has started successfully and continues on >its merry way. The result was that sometimes a guest would be started, >but there would be no passt process for qemu to use for network >traffic. > >Instead, we should be starting passt in the same manner we start >dnsmasq - we just exec it as normal (along with a request that passt >create the pidfile, which is just another option on the passt >commandline) and wait for the child process to exit; passt then has a >chance to parse its commandline and complete all the setup prior to >daemonizing itself; if it encounters an error and exits with a non-0 >code, libvirt will see the code and know about the failure. We can >then grab the output from stderr, log that so the "user" has some idea >of what went wrong, and then fail the guest startup. > >Signed-off-by: Laine Stump Reviewed-by: Martin Kletzander --yVYfs5J3c3qiv3NL Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiXAnXDYdKAaCyvS1CB/CnyQXht0FAmPks1sACgkQCB/CnyQX ht0RTA//SXgMg2jrkHDBU62zMg0gOSSNqd6G9a7IAsOkLJCkztaCX+2875nJL2qa B93Gv7z1+xYLnJjUmTuoh2SHI2OXNbCJLnk2Jq/Fby7EPpy6B7HW+yqC8qR3SNXD Ljo9ipKGWV/VyMueSvDb/+0TmXapFEQwnoiu1ZvtWSeg0xOtmKgPLP5v672GcOH6 LIGuYEgYGIV5Ny3XcpMH2R73OlHz2FG+Dd1F6QLoQPnm75gj7emGjoszt9JHdh6Q Kddd5xA2vXQj8cdTq3IKXF7VyKjOpZZK8qRw5db7k72VGzO0/5m+hRiLK5voU+Yu O7gAhAjqN8SSJV5MEvaF9BCD1GSEyqMJ9nG/S1Cg/R8HG1+FeJcuEZy0S+sD0mgw oKqxqp0EGYdi53o0omedAw8mz/vl/zEMYOmjRdLpHKubbIiYlaRkd9VYrG+ZPrpI MZzKu3wi87Kc4hwnex3txYEFtFdU+ZrBlkgigZnheB2TwcUl+UNFRKUB0C8fQyuA cikLpAY7C2AFYpiHp+kmhAhmNNg9ct6FqZZVRgu4ZKL/y38/akDsRd90N+/zJZ21 LKITWTbgz/VdsOMaw5pMa1mlG8xa5MCeYV/cygy+LxHgRBCUn11xHA3LSP8S3kQZ qnsUGkQNOqkCm0iOS8A/eqBmWAFkTOl3RdMwuAy/AalYtD8z7i4= =srYn -----END PGP SIGNATURE----- --yVYfs5J3c3qiv3NL--