summaryrefslogtreecommitdiffstats
path: root/qapi
diff options
context:
space:
mode:
authorVladislav Yaroshchuk2022-03-17 18:28:34 +0100
committerJason Wang2022-05-17 10:48:23 +0200
commit81ad2964e93848fc0998145043c395dea67f00da (patch)
treeae0e9e4700702879e949b385fb040451aff43f0d /qapi
parentnet/vmnet: add vmnet dependency and customizable option (diff)
downloadqemu-81ad2964e93848fc0998145043c395dea67f00da.tar.gz
qemu-81ad2964e93848fc0998145043c395dea67f00da.tar.xz
qemu-81ad2964e93848fc0998145043c395dea67f00da.zip
net/vmnet: add vmnet backends to qapi/net
Create separate netdevs for each vmnet operating mode: - vmnet-host - vmnet-shared - vmnet-bridged Reviewed-by: Akihiko Odaki <akihiko.odaki@gmail.com> Tested-by: Akihiko Odaki <akihiko.odaki@gmail.com> Acked-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Vladislav Yaroshchuk <Vladislav.Yaroshchuk@jetbrains.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'qapi')
-rw-r--r--qapi/net.json133
1 files changed, 131 insertions, 2 deletions
diff --git a/qapi/net.json b/qapi/net.json
index b92f3f5fb4..d6f7cfd4d6 100644
--- a/qapi/net.json
+++ b/qapi/net.json
@@ -453,6 +453,120 @@
'*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 host.
+#
+# @start-address: The starting IPv4 address to use for the interface.
+# Must be in the private IP range (RFC 1918). Must be
+# specified along with @end-address and @subnet-mask.
+# This address is used as the gateway address. The
+# subsequent address up to and including end-address are
+# placed in the DHCP pool.
+#
+# @end-address: 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 @start-address and
+# @subnet-mask.
+#
+# @subnet-mask: The IPv4 subnet mask to use on the interface. Must
+# be specified along with @start-address and @subnet-mask.
+#
+# @isolated: Enable isolation for this interface. Interface isolation
+# ensures that vmnet interface is not able to communicate
+# with any other vmnet interfaces. Only communication with
+# host is allowed. Requires at least macOS Big Sur 11.0.
+#
+# @net-uuid: The identifier (UUID) to uniquely identify the isolated
+# network vmnet interface should be added to. If
+# set, no DHCP service is provided for this interface and
+# network communication is allowed only with other interfaces
+# added to this network identified by the UUID. Requires
+# at least macOS Big Sur 11.0.
+#
+# Since: 7.1
+##
+{ 'struct': 'NetdevVmnetHostOptions',
+ 'data': {
+ '*start-address': 'str',
+ '*end-address': 'str',
+ '*subnet-mask': '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 communicate with the host and with
+# other shared mode interfaces on the same subnet. If no DHCP
+# settings, subnet mask and IPv6 prefix specified, the interface can
+# communicate with any of other interfaces in shared mode.
+#
+# @start-address: The starting IPv4 address to use for the interface.
+# Must be in the private IP range (RFC 1918). Must be
+# specified along with @end-address and @subnet-mask.
+# This address is used as the gateway address. The
+# subsequent address up to and including end-address are
+# placed in the DHCP pool.
+#
+# @end-address: 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 @start-address and @subnet-mask.
+#
+# @subnet-mask: The IPv4 subnet mask to use on the interface. Must
+# be specified along with @start-address and @subnet-mask.
+#
+# @isolated: Enable isolation for this interface. Interface isolation
+# ensures that vmnet interface is not able to communicate
+# with any other vmnet interfaces. Only communication with
+# host is allowed. Requires at least macOS Big Sur 11.0.
+#
+# @nat66-prefix: The IPv6 prefix to use into guest network. Must be a
+# unique local address i.e. start with fd00::/8 and have
+# length of 64.
+#
+# Since: 7.1
+##
+{ 'struct': 'NetdevVmnetSharedOptions',
+ 'data': {
+ '*start-address': 'str',
+ '*end-address': 'str',
+ '*subnet-mask': 'str',
+ '*isolated': 'bool',
+ '*nat66-prefix': 'str' },
+ '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 vmnet interface is not able to communicate
+# with any other vmnet interfaces. Only communication with
+# host is allowed. Requires at least macOS Big Sur 11.0.
+#
+# Since: 7.1
+##
+{ 'struct': 'NetdevVmnetBridgedOptions',
+ 'data': {
+ 'ifname': 'str',
+ '*isolated': 'bool' },
+ 'if': 'CONFIG_VMNET' }
+
+##
# @NetClientDriver:
#
# Available netdev drivers.
@@ -460,10 +574,16 @@
# Since: 2.7
#
# @vhost-vdpa since 5.1
+# @vmnet-host since 7.1
+# @vmnet-shared since 7.1
+# @vmnet-bridged since 7.1
##
{ '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 +597,9 @@
# Since: 1.2
#
# 'l2tpv3' - since 2.1
+# 'vmnet-host' - since 7.1
+# 'vmnet-shared' - since 7.1
+# 'vmnet-bridged' - since 7.1
##
{ 'union': 'Netdev',
'base': { 'id': 'str', 'type': 'NetClientDriver' },
@@ -492,7 +615,13 @@
'hubport': 'NetdevHubPortOptions',
'netmap': 'NetdevNetmapOptions',
'vhost-user': 'NetdevVhostUserOptions',
- 'vhost-vdpa': 'NetdevVhostVDPAOptions' } }
+ 'vhost-vdpa': 'NetdevVhostVDPAOptions',
+ 'vmnet-host': { 'type': 'NetdevVmnetHostOptions',
+ 'if': 'CONFIG_VMNET' },
+ 'vmnet-shared': { 'type': 'NetdevVmnetSharedOptions',
+ 'if': 'CONFIG_VMNET' },
+ 'vmnet-bridged': { 'type': 'NetdevVmnetBridgedOptions',
+ 'if': 'CONFIG_VMNET' } } }
##
# @RxState: