[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 2/6] net/vmnet: add vmnet backends to qapi/net
From: |
Markus Armbruster |
Subject: |
Re: [PATCH v4 2/6] net/vmnet: add vmnet backends to qapi/net |
Date: |
Tue, 09 Nov 2021 06:40:51 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Vladislav Yaroshchuk <yaroshchuk2000@gmail.com> writes:
> Create separate netdevs for each vmnet operating mode:
> - vmnet-host
> - vmnet-shared
> - vmnet-bridged
>
> Signed-off-by: Vladislav Yaroshchuk <yaroshchuk2000@gmail.com>
[...]
> diff --git a/qapi/net.json b/qapi/net.json
> index 7fab2e7cd8..087cdf0546 100644
> --- a/qapi/net.json
> +++ b/qapi/net.json
> @@ -452,6 +452,112 @@
> '*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.
In QMP, we separate words by dashes, like @dhcp-start. We may prefer
not to here, for consistency with NetdevUserOptions, ...
> +#
> +# @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.
... and here, to match @dhcpstart.
> +#
> +# @subnetmask: The IPv4 subnet mask to use on the interface. Must
> +# be specified along with @dhcpstart and @subnetmask.
@subnet-mask, please.
No support for IPv6?
> +#
> +# @isolated: Enable isolation for this interface. Interface isolation
> +# ensures that network communication between multiple
> +# vmnet interfaces instances is not possible.
> +#
> +# @net-uuid: The identifier (UUID) to uniquely identify the network.
> +# If provided, no DHCP service is provided on this network
> +# and the interface is added to an isolated network with
> +# the specified identifier.
Out of curiosity: identify to whom?
If I set @net-uuid, I get an isolated network with a UUID, and if I set
"isolated": true, I get one without a UUID. When would I want the
former, and when the latter?
What happens when I set "isolated": false together with @net-uuid?
When "no DCHCP service is provided", then @dhcpstart and @dhcpend become
misnomers. Compare NetdevUserOptions: it uses @net to specify the
address range, and dhcpstart to specify the DHCP range (@dhcpend is
implied). Should we aim for consistency between the two?
> +#
> +# Since: 6.2
Missed 6.2, please adjust. More of the same below.
> +##
> +{ 'struct': 'NetdevVmnetHostOptions',
> + 'data': {
> + '*dhcpstart': 'str',
> + '*dhcpend': 'str',
> + '*subnetmask': 'str',
> + '*isolated': 'bool',
> + '*net-uuid': '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
Do you mean "subnet mask"?
> +# 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.
> +#
> +# @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.
> +#
> +# @isolated: Enable isolation for this interface. Interface isolation
> +# ensures that network communication between multiple
> +# vmnet interfaces instances is not possible.
> +#
> +# Since: 6.2
> +##
> +{ 'struct': 'NetdevVmnetSharedOptions',
> + 'data': {
> + '*dhcpstart': 'str',
> + '*dhcpend': 'str',
> + '*subnetmask': 'str',
> + '*isolated': 'bool'
> + },
> + 'if': 'CONFIG_VMNET' }
> +
> +##
> +# @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.
> +#
> +# @isolated: Enable isolation for this interface. Interface isolation
> +# ensures that network communication between multiple
> +# vmnet interfaces instances is not possible.
> +#
> +# Since: 6.2
> +##
> +{ 'struct': 'NetdevVmnetBridgedOptions',
> + 'data': {
> + 'ifname': 'str',
> + '*isolated': 'str'
> + },
> + 'if': 'CONFIG_VMNET' }
> +
> ##
> # @NetClientDriver:
> #
> @@ -460,10 +566,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 +589,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 +607,10 @@
> 'hubport': 'NetdevHubPortOptions',
> 'netmap': 'NetdevNetmapOptions',
> 'vhost-user': 'NetdevVhostUserOptions',
> - 'vhost-vdpa': 'NetdevVhostVDPAOptions' } }
> + 'vhost-vdpa': 'NetdevVhostVDPAOptions',
> + 'vmnet-host': 'NetdevVmnetHostOptions',
> + 'vmnet-shared': 'NetdevVmnetSharedOptions',
> + 'vmnet-bridged': 'NetdevVmnetBridgedOptions' } }
>
> ##
> # @RxState:
[PATCH v4 4/6] net/vmnet: implement host mode (vmnet-host), Vladislav Yaroshchuk, 2021/11/08
[PATCH v4 6/6] net/vmnet: update qemu-options.hx, Vladislav Yaroshchuk, 2021/11/08
[PATCH v4 1/6] net/vmnet: add vmnet dependency and customizable option, Vladislav Yaroshchuk, 2021/11/08
[PATCH v4 5/6] net/vmnet: implement bridged mode (vmnet-bridged), Vladislav Yaroshchuk, 2021/11/08
[PATCH v4 3/6] net/vmnet: implement shared mode (vmnet-shared), Vladislav Yaroshchuk, 2021/11/08