qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 1/6] net/vmnet: dependencies setup, initial preparations


From: Vladislav Yaroshchuk
Subject: Re: [PATCH v2 1/6] net/vmnet: dependencies setup, initial preparations
Date: Tue, 12 Oct 2021 13:14:34 +0300

Thank you, Eric!

Now fixing all the QAPI issues.


пн, 11 окт. 2021 г. в 21:45, Eric Blake <eblake@redhat.com>:
On Tue, Aug 31, 2021 at 10:27:15PM +0300, Vladislav Yaroshchuk wrote:
> Add 'vmnet' customizable option and 'vmnet.framework' probe into
> configure;
>
> Create separate netdev per each vmnet operating mode
> because they use quite different settings. Especially since
> macOS 11.0 (vmnet.framework API gets lots of updates)
> Create source files for network client driver, update meson.build;
>
> Three new netdevs are added:
> - vmnet-host
> - vmnet-shared
> - vmnet-bridged
>
> Signed-off-by: Vladislav Yaroshchuk <yaroshchuk2000@gmail.com>
> ---

While I'm not the best for reviewing the overall series, I can at
least comment on the proposed QAPI changes:

> +++ b/qapi/net.json
> @@ -452,6 +452,89 @@
>      '*vhostdev':     'str',
>      '*queues':       'int' } }

> +##
> +# @NetdevVmnetHostOptions:
> +#
> +# vmnet (host mode) network backend.
> +#
> +# Allows the vmnet interface to communicate with
> +# other vmnet interfaces that are in host mode and also with the native host.
> +#
> +# @dhcpstart: The starting IPv4 address to use for the interface. Must be in the
> +#             private IP range (RFC 1918). Must be specified along
> +#             with @dhcpend and @subnetmask.
> +#             This address is used as the gateway address. The subsequent address
> +#             up to and including dhcpend are placed in the DHCP pool.

Long lines.  Most of the qapi docs wrap around 70 or so columns rather
than pushing right up to the 80 column limit.

> +#
> +# @dhcpend: The DHCP IPv4 range end address to use for the interface. Must be in
> +#           the private IP range (RFC 1918). Must be specified along
> +#           with @dhcpstart and @subnetmask.
> +#
> +# @subnetmask: The IPv4 subnet mask to use on the interface. Must be specified
> +#              along with @dhcpstart and @subnetmask.
> +#
> +#
> +# Since: 6.2,

Drop the trailing comma

> +##
> +{ 'struct': 'NetdevVmnetHostOptions',
> +  'data': {
> +    '*dhcpstart':   'str',
> +    '*dhcpend':     'str',
> +    '*subnetmask':  'str'
> +  },
> +  'if': 'CONFIG_VMNET' }
> +
> +##
> +# @NetdevVmnetSharedOptions:
> +#
> +# vmnet (shared mode) network backend.
> +#
> +# Allows traffic originating from the vmnet interface to reach the
> +# Internet through a network address translator (NAT). The vmnet interface
> +# can also communicate with the native host. By default, the vmnet interface
> +# is able to communicate with other shared mode interfaces. If a subnet range
> +# is specified, the vmnet interface can communicate with other shared mode
> +# interfaces on the same subnet.
> +#
> +# @dhcpstart: The starting IPv4 address to use for the interface. Must be in the
> +#             private IP range (RFC 1918). Must be specified along
> +#             with @dhcpend and @subnetmask.
> +#             This address is used as the gateway address. The subsequent address
> +#             up to and including dhcpend are  placed in the DHCP pool.

extra space

> +#
> +# @dhcpend: The DHCP IPv4 range end address to use for the interface. Must be in
> +#           the private IP range (RFC 1918). Must be specified along
> +#           with @dhcpstart and @subnetmask.
> +#
> +# @subnetmask: The IPv4 subnet mask to use on the interface. Must be specified
> +#              along with @dhcpstart and @subnetmask.
> +#
> +#
> +# Since: 6.2,

Another odd comma

> +##
> +{ 'struct': 'NetdevVmnetSharedOptions',
> +  'data': {
> +    '*dhcpstart':    'str',
> +    '*dhcpend':      'str',
> +    '*subnetmask':   'str'
> +  },
> +  'if': 'CONFIG_VMNET' }

The NetdevVmnetHostOptions and NetdevVmnetSharedOptions types are
identical; why do you need two types?

The NetdevVmnetHostOptions and NetdevVmnetSharedOptions have differences in other non-implemented options, such as IPv6 prefix configuring only for `vmnet-shared`, and  subnets isolation by assigning them UUIDs for `vmnet-host`. I have plans about implementing these features in the near future. Separated options objects were created because of this.
> +
> +##
> +# @NetdevVmnetBridgedOptions:
> +#
> +# vmnet (bridged mode) network backend.
> +#
> +# Bridges the vmnet interface with a physical network interface.
> +#
> +# @ifname: The name of the physical interface to be bridged.
> +#
> +# Since: 6.2
> +##
> +{ 'struct': 'NetdevVmnetBridgedOptions',
> +  'data': { 'ifname': 'str' },
> +  'if': 'CONFIG_VMNET' }
> +
>  ##
>  # @NetClientDriver:
>  #
> @@ -460,10 +543,16 @@
>  # Since: 2.7
>  #
>  #        @vhost-vdpa since 5.1
> +#        @vmnet-host since 6.2
> +#        @vmnet-shared since 6.2
> +#        @vmnet-bridged since 6.2
>  ##
>  { 'enum': 'NetClientDriver',
>    'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde',
> -            'bridge', 'hubport', 'netmap', 'vhost-user', 'vhost-vdpa' ] }
> +            'bridge', 'hubport', 'netmap', 'vhost-user', 'vhost-vdpa',
> +            { 'name': 'vmnet-host', 'if': 'CONFIG_VMNET' },
> +            { 'name': 'vmnet-shared', 'if': 'CONFIG_VMNET' },
> +            { 'name': 'vmnet-bridged', 'if': 'CONFIG_VMNET' }] }

>  ##
>  # @Netdev:
> @@ -477,6 +566,9 @@
>  # Since: 1.2
>  #
>  #        'l2tpv3' - since 2.1
> +#        'vmnet-host' - since 6.2
> +#        'vmnet-shared' - since 6.2
> +#        'vmnet-bridged' - since 6.2
>  ##
>  { 'union': 'Netdev',
>    'base': { 'id': 'str', 'type': 'NetClientDriver' },
> @@ -492,7 +584,10 @@
>      'hubport':  'NetdevHubPortOptions',
>      'netmap':   'NetdevNetmapOptions',
>      'vhost-user': 'NetdevVhostUserOptions',
> -    'vhost-vdpa': 'NetdevVhostVDPAOptions' } }
> +    'vhost-vdpa': 'NetdevVhostVDPAOptions',
> +    'vmnet-host': 'NetdevVmnetHostOptions',
> +    'vmnet-shared': 'NetdevVmnetSharedOptions',

If you only declare one type instead of two above, then both these
branches can use that same type.

> +    'vmnet-bridged': 'NetdevVmnetBridgedOptions' } }

>  ##
>  # @RxState:
> --
> 2.23.0
>
>

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

 
Best Regards,
Vladislav Yaroshchuk


reply via email to

[Prev in Thread] Current Thread [Next in Thread]