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 X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 415AFC433DB for ; Fri, 5 Feb 2021 00:26:20 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8312B64DB1 for ; Fri, 5 Feb 2021 00:26:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8312B64DB1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:39854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7ox0-0002C7-Cb for qemu-devel@archiver.kernel.org; Thu, 04 Feb 2021 19:26:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7owI-0001dG-4R for qemu-devel@nongnu.org; Thu, 04 Feb 2021 19:25:34 -0500 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]:51442) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7owE-00088p-BV for qemu-devel@nongnu.org; Thu, 04 Feb 2021 19:25:33 -0500 Received: by mail-pj1-x102c.google.com with SMTP id fa16so2230880pjb.1 for ; Thu, 04 Feb 2021 16:25:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yhq6nyp8mJUGJ8gSIuE0jFQ9lgf56BdS5D/OT2ntMEg=; b=St5xbT4CDmXVYy0rUln0mhki2zJcvi5X9+dKRwJHpjmMBTp73xEOOBsjydgIwwLQ+r LQoBYmSlijV53F/EZE/dwU1g4XG3LcWT/ubwyqc77t4JZ+PipLyfS0r6ZklEWSgM2MQU ueiG+rjFYCVEcI/8nwxel2SxvBfCo6vC1IYl90sXk8qAKRk75DB/rEfPRjqKZfVDjPF/ 4w0qyBXYm4rusKozwftMK/rIyjxCwhO/4kIqYaAwG3m5gbipqfSRcwDqkRmDHe/X3KS8 NvL00Tn5Olbz29CYBfMETcew83ZCapQj7M4dow0U9Ds4b8r9B8KxWvTVLm383DMZBfh8 wUHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yhq6nyp8mJUGJ8gSIuE0jFQ9lgf56BdS5D/OT2ntMEg=; b=MvbSESm/u69uthHAq2yoQ8rDw2r/f4hMIWiGlrk0ZUH5ueyJRuB+z11X1L9CjMKhNW lYFdGUXqMOHIRjv3WendlEPHBN0EHOtPF4bnqghrwK1dfCe0j7j/+ai8xeTTWFAbUFdQ Cuf6dblRkUg0bwdYgrhZFCeXCdcw08IbvFTX8cIOL0MVLKmweFQCnIUGEH/6TpE26HlX wp9ccG5vaEzpIQhPNgApEWVSd2cFllQviiiZBqTz9xnBLYN0lFuehjOgPjMAGg3u9W41 WFFYCN04tyn5oKUDfPUDfgz8oTASIy39lwcdBNNQOQgNcM1PtJG0eIqO7u3/vd+Ok8v8 jllg== X-Gm-Message-State: AOAM532F8FqU3bRR9kLxmJcci/TUBv9J2JETNk/3bYX1bYLRrH+kqw5S tBwYVLddeHUp3MRBUY9It04Bj+Vk1I3/bgpskd0= X-Google-Smtp-Source: ABdhPJwDIXBHZe55IExiirIbKRGBKwrjCyyxjkwCsILcAuXGPlktSo3+0TJphmD5giqEpvvUsrMb3BAtLbqjilywU0w= X-Received: by 2002:a17:903:4111:b029:e2:843c:42d4 with SMTP id r17-20020a1709034111b02900e2843c42d4mr1729642pld.45.1612484728638; Thu, 04 Feb 2021 16:25:28 -0800 (PST) MIME-Version: 1.0 References: <20210204162544.65439-1-phillip.ennen@gmail.com> <20210204162544.65439-3-phillip.ennen@gmail.com> In-Reply-To: From: Phillip Tennen Date: Fri, 5 Feb 2021 01:25:17 +0100 Message-ID: Subject: Re: [PATCH 2/2] net: implement vmnet-based netdev To: Eric Blake Content-Type: multipart/alternative; boundary="00000000000074cff805ba8bdb3b" Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=phillip.ennen@gmail.com; helo=mail-pj1-x102c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefan Hajnoczi , jasowang@redhat.com, qemu-devel@nongnu.org, Markus Armbruster , Phillip Tennen Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --00000000000074cff805ba8bdb3b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks very much for taking a look! As per my understanding of the submission process, I will resubmit this patchset (sans my self-introduction =3D) ) in a new [PATCH v2] thread, incorporating the changes you pointed out here. > Adding Markus in cc; right now, I don't think QAPI supports a union type > as a branch to another union type. There's nothing that technically > would prevent us from doing that, just the grunt work of modifying the > QAPI code generator to support it. I'm unfamiliar with the QAPI codegen and what it supports~ The `mode` param is shared by all three mode types. Thus, could I make the `NetdevVmnetOptions` contain a mode field and a mode-specific union of options, to avoid the direct union-union nesting? Phillip On Thu, Feb 4, 2021 at 8:51 PM Eric Blake wrote: > On 2/4/21 10:25 AM, phillip.ennen@gmail.com wrote: > > From: Phillip Tennen > > > > This patch implements a new netdev device, reachable via -netdev > > vmnet-macos, that=E2=80=99s backed by macOS=E2=80=99s vmnet framework. > > > > The vmnet framework provides native bridging support, and its usage in > > this patch is intended as a replacement for attempts to use a tap devic= e > > via the tuntaposx kernel extension. Notably, the tap/tuntaposx approach > > never would have worked in the first place, as QEMU interacts with the > > tap device via poll(), and macOS does not support polling device files. > > > > > This is my first QEMU contribution, so please feel free to let me know > > what I=E2=80=99ve missed or what needs improving. Thanks very much for = taking a > > look =3D) > > This paragraph would fit better... > > > > > Signed-off-by: Phillip Tennen > > --- > > ...here, after the --- marker. It's useful to the reviewer (and welcome > to the community, by the way!), but does not need to be enshrined in git > history. > > > configure | 2 +- > > net/clients.h | 6 + > > net/meson.build | 1 + > > net/net.c | 3 + > > net/vmnet-macos.c | 444 ++++++++++++++++++++++++++++++++++++++++++++++ > > qapi/net.json | 64 ++++++- > > qemu-options.hx | 9 + > > I'm focusing mainly on the UI aspects, and did not look closely at the > rest. > > > +++ b/qapi/net.json > > @@ -450,6 +450,65 @@ > > '*vhostdev': 'str', > > '*queues': 'int' } } > > > > +## > > +# @VmnetOperatingMode: > > +# > > +# An enumeration of the I/O operation types > > +# > > +# @host: the guest may communicate with the host > > +# and other guest network interfaces > > +# > > +# @shared: the guest may reach the Internet through a NAT, > > +# and may communicate with the host and other guest > > +# network interfaces > > +# > > +# @bridged: the guest's traffic is bridged with a > > +# physical network interface of the host > > +# > > +# Since: 5.3 > > The next release will be 6.0, not 5.3. > > > +## > > +{ 'enum': 'VmnetOperatingMode', > > + 'data': [ 'host', 'shared', 'bridged' ] } > > + > > +## > > +# @NetdevVmnetOptions: > > +# > > +# vmnet network backend (only available on macOS) > > +# > > +# @mode: the operating mode vmnet should run in > > +# > > +# @ifname: the physical network interface to bridge with > > +# (only valid with mode=3Dbridged) > > If this is only valid with bridged, then you should use a union type, > where only the bridged branch supports this member. That is more > typesafe than always supporting it in the schema and having to > semantically filter it out after the fact. > > > +# > > +# @dhcp_start_address: the gateway address to use for the interface. > > New QAPI additions should favor names with '-' rather than '_', as in > dhcp-start-address; the exception is if you are closely copying another > older interface that already used _. > > > +# The range to dhcp_end_address is placed in the > DHCP pool. > > +# (only valid with mode=3Dhost|shared) > > +# (must be specified with dhcp_end_address and > > +# dhcp_subnet_mask) > > +# (allocated automatically if unset) > > +# > > +# @dhcp_end_address: the DHCP IPv4 range end address to use for the > interface. > > +# (only valid with mode=3Dhost|shared) > > +# (must be specified with dhcp_start_address and > > +# dhcp_subnet_mask) > > +# (allocated automatically if unset) > > +# > > +# @dhcp_subnet_mask: the IPv4 subnet mask (string) to use on the > interface. > > +# (only valid with mode=3Dhost|shared) > > +# (must be specified with dhcp_start_address and > > +# dhcp_end_address) > > +# (allocated automatically if unset) > > +# > > +# Since: 5.3 > > 6.0 > > > +## > > +{ 'struct': 'NetdevVmnetOptions', > > + 'data': { > > + 'mode': 'VmnetOperatingMode', > > + '*ifname': 'str', > > + '*dhcp_start_address': 'str', > > + '*dhcp_end_address': 'str', > > + '*dhcp_subnet_mask': 'str' } } > > In addition to my suggestion of making this a union rather than a > struct, you probably also want to include an 'if' tag so that the struct > is present only on MacOS builds (it's nicer for introspection to not > advertise something that won't work). > > > + > > ## > > # @NetClientDriver: > > # > > @@ -461,7 +520,7 @@ > > ## > > { 'enum': 'NetClientDriver', > > 'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde', > > - 'bridge', 'hubport', 'netmap', 'vhost-user', 'vhost-vdpa' = ] > } > > + 'bridge', 'hubport', 'netmap', 'vhost-user', 'vhost-vdpa', > 'vmnet-macos' ] } > > Missing a doc mention that 'vmnet-macos' is new to 6.0. > > > > > ## > > # @Netdev: > > @@ -490,7 +549,8 @@ > > 'hubport': 'NetdevHubPortOptions', > > 'netmap': 'NetdevNetmapOptions', > > 'vhost-user': 'NetdevVhostUserOptions', > > - 'vhost-vdpa': 'NetdevVhostVDPAOptions' } } > > + 'vhost-vdpa': 'NetdevVhostVDPAOptions', > > + 'vmnet-macos': 'NetdevVmnetOptions' } } > > Adding Markus in cc; right now, I don't think QAPI supports a union type > as a branch to another union type. There's nothing that technically > would prevent us from doing that, just the grunt work of modifying the > QAPI code generator to support it. > > > > > ## > > # @NetFilterDirection: > > diff --git a/qemu-options.hx b/qemu-options.hx > > index 9172d51659..ec6b40b079 100644 > > --- a/qemu-options.hx > > +++ b/qemu-options.hx > > @@ -2483,6 +2483,15 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev, > > #ifdef __linux__ > > "-netdev vhost-vdpa,id=3Dstr,vhostdev=3D/path/to/dev\n" > > " configure a vhost-vdpa network,Establish a > vhost-vdpa netdev\n" > > +#endif > > +#ifdef CONFIG_DARWIN > > + "-netdev vmnet-macos,id=3Dstr,mode=3Dbridged[,ifname=3Difname]\n" > > + " configure a macOS-provided vmnet network in \"physical > interface bridge\" mode\n" > > + " the physical interface to bridge with defaults to en0 if > unspecified\n" > > + "-netdev vmnet-macos,id=3Dstr,mode=3Dhost|shared\n" > > + " > [,dhcp_start_address=3Daddr,dhcp_end_address=3Daddr,dhcp_subnet_mask=3Dm= ask]\n" > > + " configure a macOS-provided vmnet network in \"host\" or > \"shared\" mode\n" > > + " the DHCP configuration will be set automatically if > unspecified\n" > > #endif > > "-netdev hubport,id=3Dstr,hubid=3Dn[,netdev=3Dnd]\n" > > " configure a hub port on the hub with ID 'n'\n", > QEMU_ARCH_ALL) > > > > -- > Eric Blake, Principal Software Engineer > Red Hat, Inc. +1-919-301-3226 > Virtualization: qemu.org | libvirt.org > > --00000000000074cff805ba8bdb3b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks = very much for taking a look!=C2=A0

As per my understanding of = the submission process, I will resubmit this patchset (sans my self-introdu= ction =3D) )
in a new [PATCH v2] thread, incorporating the change= s you pointed out here.

> Adding Markus in cc;= right now, I don't think QAPI supports a union type
> as a branc= h to another union type. There's nothing that technically
> would= prevent us from doing that, just the grunt work of modifying the
> Q= API code generator to support it.

I= 9;m unfamiliar with the QAPI codegen and what it supports~=C2=A0
= The `mode` param is shared by all three mode types. Thus,=C2=A0
c= ould I make the `NetdevVmnetOptions` contain a mode field
and a m= ode-specific union of options, to avoid the direct union-union=C2=A0
<= div>nesting?

Phillip

On Thu, Feb 4, 2021 at 8:51 PM= Eric Blake <eblake@redhat.com&= gt; wrote:
On 2/4/21 10:25 AM, phillip.ennen@gmail.com wrot= e:
> From: Phillip Tennen <phillip@axleos.com>
>
> This patch implements a new netdev device, reachable via -netdev
> vmnet-macos, that=E2=80=99s backed by macOS=E2=80=99s vmnet framework.=
>
> The vmnet framework provides native bridging support, and its usage in=
> this patch is intended as a replacement for attempts to use a tap devi= ce
> via the tuntaposx kernel extension. Notably, the tap/tuntaposx approac= h
> never would have worked in the first place, as QEMU interacts with the=
> tap device via poll(), and macOS does not support polling device files= .
>

> This is my first QEMU contribution, so please feel free to let me know=
> what I=E2=80=99ve missed or what needs improving. Thanks very much for= taking a
> look =3D)

This paragraph would fit better...

>
> Signed-off-by: Phillip Tennen <phillip@axleos.com>
> ---

...here, after the --- marker.=C2=A0 It's useful to the reviewer (and w= elcome
to the community, by the way!), but does not need to be enshrined in git history.

>=C2=A0 configure=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A02 +- >=C2=A0 net/clients.h=C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A06 +
>=C2=A0 net/meson.build=C2=A0 =C2=A0|=C2=A0 =C2=A01 +
>=C2=A0 net/net.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A03 +
>=C2=A0 net/vmnet-macos.c | 444 ++++++++++++++++++++++++++++++++++++++++= ++++++
>=C2=A0 qapi/net.json=C2=A0 =C2=A0 =C2=A0|=C2=A0 64 ++++++-
>=C2=A0 qemu-options.hx=C2=A0 =C2=A0|=C2=A0 =C2=A09 +

I'm focusing mainly on the UI aspects, and did not look closely at the = rest.

> +++ b/qapi/net.json
> @@ -450,6 +450,65 @@
>=C2=A0 =C2=A0 =C2=A0 '*vhostdev':=C2=A0 =C2=A0 =C2=A0'str&#= 39;,
>=C2=A0 =C2=A0 =C2=A0 '*queues':=C2=A0 =C2=A0 =C2=A0 =C2=A0'= int' } }
>=C2=A0
> +##
> +# @VmnetOperatingMode:
> +#
> +# An enumeration of the I/O operation types
> +#
> +# @host: the guest may communicate with the host
> +#=C2=A0 =C2=A0 =C2=A0 =C2=A0 and other guest network interfaces
> +#
> +# @shared: the guest may reach the Internet through a NAT,
> +#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 and may communicate with the host= and other guest
> +#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 network interfaces
> +#
> +# @bridged: the guest's traffic is bridged with a
> +#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0physical network interface = of the host
> +#
> +# Since: 5.3

The next release will be 6.0, not 5.3.

> +##
> +{ 'enum': 'VmnetOperatingMode',
> +=C2=A0 'data': [ 'host', 'shared', 'bridg= ed' ] }
> +
> +##
> +# @NetdevVmnetOptions:
> +#
> +# vmnet network backend (only available on macOS)
> +#
> +# @mode: the operating mode vmnet should run in
> +#
> +# @ifname: the physical network interface to bridge with
> +#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (only valid with mode=3Dbridged)<= br>
If this is only valid with bridged, then you should use a union type,
where only the bridged branch supports this member.=C2=A0 That is more
typesafe than always supporting it in the schema and having to
semantically filter it out after the fact.

> +#
> +# @dhcp_start_address: the gateway address to use for the interface. =

New QAPI additions should favor names with '-' rather than '_&#= 39;, as in
dhcp-start-address; the exception is if you are closely copying another
older interface that already used _.

> +#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 The range to dhcp_end_address is placed in the DHCP pool.
> +#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (only valid with mode=3Dhost|shared)
> +#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (must be specified with dhcp_end_address and
> +#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0dhcp_subnet_mask)
> +#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (allocated automatically if unset)
> +#
> +# @dhcp_end_address: the DHCP IPv4 range end address to use for the i= nterface.
> +#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (only valid with mode=3Dhost|shared)
> +#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (must be specified with dhcp_start_address and
> +#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0dhcp_subnet_mask)
> +#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (allocated automatically if unset)
> +#
> +# @dhcp_subnet_mask: the IPv4 subnet mask (string) to use on the inte= rface.
> +#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 (only valid with mode=3Dhost|shared)
> +#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 (must be specified with dhcp_start_address and
> +#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0dhcp_end_address)
> +#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 (allocated automatically if unset)
> +#
> +# Since: 5.3

6.0

> +##
> +{ 'struct': 'NetdevVmnetOptions',
> +=C2=A0 'data': {
> +=C2=A0 =C2=A0 'mode':=C2=A0 =C2=A0 =C2=A0 =C2=A0 'VmnetOp= eratingMode',
> +=C2=A0 =C2=A0 '*ifname':=C2=A0 =C2=A0 =C2=A0 =C2=A0 'str&= #39;,
> +=C2=A0 =C2=A0 '*dhcp_start_address':=C2=A0 =C2=A0 =C2=A0 '= ;str',
> +=C2=A0 =C2=A0 '*dhcp_end_address':=C2=A0 =C2=A0 =C2=A0 =C2=A0= 'str',
> +=C2=A0 =C2=A0 '*dhcp_subnet_mask':=C2=A0 =C2=A0 =C2=A0 =C2=A0= 'str' } }

In addition to my suggestion of making this a union rather than a
struct, you probably also want to include an 'if' tag so that the s= truct
is present only on MacOS builds (it's nicer for introspection to not advertise something that won't work).

> +
>=C2=A0 ##
>=C2=A0 # @NetClientDriver:
>=C2=A0 #
> @@ -461,7 +520,7 @@
>=C2=A0 ##
>=C2=A0 { 'enum': 'NetClientDriver',
>=C2=A0 =C2=A0 'data': [ 'none', 'nic', 'use= r', 'tap', 'l2tpv3', 'socket', 'vde', > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 'bridge', 'hubp= ort', 'netmap', 'vhost-user', 'vhost-vdpa' ] }<= br> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 'bridge', 'hubp= ort', 'netmap', 'vhost-user', 'vhost-vdpa', = 9;vmnet-macos' ] }

Missing a doc mention that 'vmnet-macos' is new to 6.0.

>=C2=A0
>=C2=A0 ##
>=C2=A0 # @Netdev:
> @@ -490,7 +549,8 @@
>=C2=A0 =C2=A0 =C2=A0 'hubport':=C2=A0 'NetdevHubPortOptions= ',
>=C2=A0 =C2=A0 =C2=A0 'netmap':=C2=A0 =C2=A0'NetdevNetmapOpt= ions',
>=C2=A0 =C2=A0 =C2=A0 'vhost-user': 'NetdevVhostUserOptions&= #39;,
> -=C2=A0 =C2=A0 'vhost-vdpa': 'NetdevVhostVDPAOptions' = } }
> +=C2=A0 =C2=A0 'vhost-vdpa': 'NetdevVhostVDPAOptions',=
> +=C2=A0 =C2=A0 'vmnet-macos': 'NetdevVmnetOptions' } }=

Adding Markus in cc; right now, I don't think QAPI supports a union typ= e
as a branch to another union type. There's nothing that technically
would prevent us from doing that, just the grunt work of modifying the
QAPI code generator to support it.

>=C2=A0
>=C2=A0 ##
>=C2=A0 # @NetFilterDirection:
> diff --git a/qemu-options.hx b/qemu-options.hx
> index 9172d51659..ec6b40b079 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -2483,6 +2483,15 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_ne= tdev,
>=C2=A0 #ifdef __linux__
>=C2=A0 =C2=A0 =C2=A0 "-netdev vhost-vdpa,id=3Dstr,vhostdev=3D/path= /to/dev\n"
>=C2=A0 =C2=A0 =C2=A0 "=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 configure a vhost-vdpa network,Establish a vhost-vdpa netdev\= n"
> +#endif
> +#ifdef CONFIG_DARWIN
> +=C2=A0 =C2=A0 "-netdev vmnet-macos,id=3Dstr,mode=3Dbridged[,ifna= me=3Difname]\n"
> +=C2=A0 =C2=A0 "=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0configure a mac= OS-provided vmnet network in \"physical interface bridge\" mode\n= "
> +=C2=A0 =C2=A0 "=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0the physical in= terface to bridge with defaults to en0 if unspecified\n"
> +=C2=A0 =C2=A0 "-netdev vmnet-macos,id=3Dstr,mode=3Dhost|shared\n= "
> +=C2=A0 =C2=A0 "=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0[,dhcp_start_address=3Daddr,dhcp_end_address=3Da= ddr,dhcp_subnet_mask=3Dmask]\n"
> +=C2=A0 =C2=A0 "=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0configure a mac= OS-provided vmnet network in \"host\" or \"shared\" mod= e\n"
> +=C2=A0 =C2=A0 "=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0the DHCP config= uration will be set automatically if unspecified\n"
>=C2=A0 #endif
>=C2=A0 =C2=A0 =C2=A0 "-netdev hubport,id=3Dstr,hubid=3Dn[,netdev= =3Dnd]\n"
>=C2=A0 =C2=A0 =C2=A0 "=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 configure a hub port on the hub with ID 'n'\n", = QEMU_ARCH_ALL)
>

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0+1-919-301-3226
Virtualization:=C2=A0 qemu.org | libvirt.org

--00000000000074cff805ba8bdb3b--