From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 17169C433F5 for ; Wed, 2 Mar 2022 19:28:47 +0000 (UTC) Received: from localhost ([::1]:46550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPUeU-0000BW-4E for qemu-devel@archiver.kernel.org; Wed, 02 Mar 2022 14:28:46 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49940) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPUYA-00016U-EQ; Wed, 02 Mar 2022 14:22:14 -0500 Received: from [2607:f8b0:4864:20::1029] (port=52886 helo=mail-pj1-x1029.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPUY8-0002WS-9C; Wed, 02 Mar 2022 14:22:13 -0500 Received: by mail-pj1-x1029.google.com with SMTP id v4so2666371pjh.2; Wed, 02 Mar 2022 11:22:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=GowkojXAz1wkAT6+sYRVxmC+1jzWkyvWgoOaFe2GzAI=; b=TrbuYO86toBF9+xXdvV9SuFJYOCKaEChA5oo5DUCZZRpbgdJSFdUg6HSnusoANKepT YwAGDGoUZlK4MhOdjn4TW5IT/lFHPVqjfgxTXRKqIbYnYPJwF2Z0Nx2sbiy8/eZ29fSn KmkBPJ6ZgZDvUx7FB0egK26lxKvQNV1/WEAt0ynYVx9QxmlwR1Ajw0rTTLFnHVjC0wmt 2tRk2SUClhg8oL2ZFsqJ6IOjs8ReGLyDWBzVk3KC0mYoXpXTCNkpqHEhbUUhn4ECrC8z hHSEHspUfrWUdQnE+X0KYwT2N/x+vmuoyCW9LjPPgT0FIjSQcGRpjyvTWsYjkBBV05HR 7NoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=GowkojXAz1wkAT6+sYRVxmC+1jzWkyvWgoOaFe2GzAI=; b=UpcWrRhf207OTjnvOss4pEmERI6k3Dba5IMlwzLfH2heHwtszPwtkhnpeEa+JgCgRH FCPY93nc69s+spLuBLxPi2VHR8FTvoekSL9JeM/gHEglaqtjgwPWobTqCCOF+Rz72/X3 HPpIYizaOuE2LqsAQgSvoViQeOjaBFmhbadwNiotV8sceTLfeSobPeq652/KLj0Y10jQ oBmmRbKAg/F8LY2fRY4OHH5GkbegQ7eSQcwWW2BcNc3ZhPWjG12v6ALMLNpp3Yc+C7Ca n0knnc2mAZ6vP3e4cgdqQLXMJqK/fZfHH0LJAqm4oHTnz17ebutKhPMeOXyqkby94F5i dYQg== X-Gm-Message-State: AOAM532I+xexBlHeiyK5v+qErYef/0+yDBBdvcm71HFgk5laasVEdw08 pl3s2ELhhJ1TEU9F6SsPgPU= X-Google-Smtp-Source: ABdhPJxpQMG1YVjUuU1HVDKoxItlkxdQTlC7TRrzQY4Skr4NFwEQxm3vqKHErao0vcxCxFiHoC1p+g== X-Received: by 2002:a17:90a:ba07:b0:1bc:a0fd:faf with SMTP id s7-20020a17090aba0700b001bca0fd0fafmr1357961pjr.194.1646248929362; Wed, 02 Mar 2022 11:22:09 -0800 (PST) Received: from [192.168.1.35] (71.red-83-50-68.dynamicip.rima-tde.net. [83.50.68.71]) by smtp.gmail.com with ESMTPSA id t5-20020a17090ae50500b001bc4ec15949sm5828982pjy.2.2022.03.02.11.22.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Mar 2022 11:22:08 -0800 (PST) Message-ID: <62af5861-15da-da1a-8546-cf3b33806c38@gmail.com> Date: Wed, 2 Mar 2022 20:22:01 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH 2/2] Allow building vhost-user in BSD Content-Language: en-US To: =?UTF-8?Q?Daniel_P=2e_Berrang=c3=a9?= References: <20220302113644.43717-1-slp@redhat.com> <20220302113644.43717-3-slp@redhat.com> <66b68bcc-8d7e-a5f7-5e6c-b2d20c26ab01@redhat.com> <8dfc9854-4d59-0759-88d0-d502ae7c552f@gmail.com> <20220302173009.26auqvy4t4rx74td@mhamilton> <85ed0856-308a-7774-a751-b20588f3d9cd@gmail.com> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1029 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pj1-x1029.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Elena Ufimtseva , kvm@vger.kernel.org, "Michael S. Tsirkin" , Eric Farman , Jagannathan Raman , Matthew Rosato , qemu-block@nongnu.org, David Hildenbrand , Alex Williamson , Halil Pasic , Christian Borntraeger , vgoyal@redhat.com, Thomas Huth , Sergio Lopez , Richard Henderson , qemu-devel@nongnu.org, qemu-s390x@nongnu.org, Stefan Hajnoczi , Kevin Wolf , John G Johnson , Cornelia Huck , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Hanna Reitz , Paolo Bonzini Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 2/3/22 18:55, Daniel P. Berrangé wrote: > On Wed, Mar 02, 2022 at 06:38:07PM +0100, Philippe Mathieu-Daudé wrote: >> On 2/3/22 18:31, Sergio Lopez wrote: >>> On Wed, Mar 02, 2022 at 06:18:59PM +0100, Philippe Mathieu-Daudé wrote: >>>> On 2/3/22 18:10, Paolo Bonzini wrote: >>>>> On 3/2/22 12:36, Sergio Lopez wrote: >>>>>> With the possibility of using pipefd as a replacement on operating >>>>>> systems that doesn't support eventfd, vhost-user can also work on BSD >>>>>> systems. >>>>>> >>>>>> This change allows enabling vhost-user on BSD platforms too and >>>>>> makes libvhost_user (which still depends on eventfd) a linux-only >>>>>> feature. >>>>>> >>>>>> Signed-off-by: Sergio Lopez >>>>> >>>>> I would just check for !windows. >>>> >>>> What about Darwin / Haiku / Illumnos? >>> >>> It should work on every system providing pipe() or pipe2(), so I guess >>> Paolo's right, every platform except Windows. FWIW, I already tested >>> it with Darwin. >> >> Wow, nice. >> >> So maybe simply check for pipe/pipe2 rather than !windows? > > NB that would make the check more fragile. > > We already use pipe/pipe2 without checking for it, because its > usage is confined to oslib-posix.c and we know all POSIX > OS have it. There is no impl at all of qemu_pipe in oslib-win.c > and the declaration is masked out too in the header file. > > Thus if we check for pipe2 and windows did ever implement it, > then we would actually break the windows build due to qemu_pipe > not existing. > > IOW, checking !windows matches our logic for picking oslib-posix.c > in builds and so is better than checking for pipe directly. OK I see, thanks.