qemu/net
Laurent Vivier 5166fe0ae4 qapi: net: add stream and dgram netdevs
Copied from socket netdev file and modified to use SocketAddress
to be able to introduce new features like unix socket.

"udp" and "mcast" are squashed into dgram netdev, multicast is detected
according to the IP address type.
"listen" and "connect" modes are managed by stream netdev. An optional
parameter "server" defines the mode (off by default)

The two new types need to be parsed the modern way with -netdev, because
with the traditional way, the "type" field of netdev structure collides with
the "type" field of SocketAddress and prevents the correct evaluation of the
command line option. Moreover the traditional way doesn't allow to use
the same type (SocketAddress) several times with the -netdev option
(needed to specify "local" and "remote" addresses).

The previous commit paved the way for parsing the modern way, but
omitted one detail: how to pick modern vs. traditional, in
netdev_is_modern().

We want to pick based on the value of parameter "type".  But how to
extract it from the option argument?

Parsing the option argument, either the modern or the traditional way,
extracts it for us, but only if parsing succeeds.

If parsing fails, there is no good option.  No matter which parser we
pick, it'll be the wrong one for some arguments, and the error
reporting will be confusing.

Fortunately, the traditional parser accepts *anything* when called in
a certain way.  This maximizes our chance to extract the value of
"type", and in turn minimizes the risk of confusing error reporting.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2022-10-28 13:28:52 +08:00
..
can util/log: Remove qemu_log_flush 2022-04-20 10:51:11 -07:00
announce.c include: move C/util-related declarations to cutils.h 2022-04-06 14:31:43 +02:00
checksum.c net/checksum: Remove unused variable in net_checksum_add_iov 2021-07-26 07:06:58 -10:00
clients.h qapi: net: add stream and dgram netdevs 2022-10-28 13:28:52 +08:00
colo-compare.c net/colo: Fix a "double free" crash to clear the conn_list 2022-07-20 16:58:08 +08:00
colo-compare.h Add the function of colo_compare_cleanup 2021-06-11 10:30:13 +08:00
colo.c net/colo.c: Fix the pointer issue reported by Coverity. 2022-09-02 10:22:39 +08:00
colo.h net/colo.c: Fix the pointer issue reported by Coverity. 2022-09-02 10:22:39 +08:00
dgram.c qapi: net: add stream and dgram netdevs 2022-10-28 13:28:52 +08:00
dump.c rtc: Move RTC function prototypes to their own header 2022-01-28 14:29:46 +00:00
eth.c net/eth: Don't consider ESP to be an IPv6 option header 2022-02-14 11:50:44 +08:00
filter-buffer.c netfilter: Use class properties 2020-12-15 10:02:07 -05:00
filter-mirror.c net/filter: Optimize filter_send to coroutine 2022-02-14 11:50:44 +08:00
filter-replay.c hw: Do not include qemu/log.h if it is not necessary 2021-05-02 17:24:50 +02:00
filter-rewriter.c net/colo: Fix a "double free" crash to clear the conn_list 2022-07-20 16:58:08 +08:00
filter.c netfilter: Use class properties 2020-12-15 10:02:07 -05:00
hub.c qapi: net: add stream and dgram netdevs 2022-10-28 13:28:52 +08:00
hub.h net: Remove deprecated [hub_id name] tuple of 'hostfwd_add' / 'hostfwd_remove' 2020-03-09 18:44:04 +00:00
l2tpv3.c net: introduce qemu_set_info_str() function 2022-10-28 13:28:52 +08:00
meson.build qapi: net: add stream and dgram netdevs 2022-10-28 13:28:52 +08:00
net.c qapi: net: add stream and dgram netdevs 2022-10-28 13:28:52 +08:00
netmap.c Do not include sysemu/sysemu.h if it's not really necessary 2021-05-02 17:24:50 +02:00
queue.c net: introduce qemu_receive_packet() 2021-03-15 16:41:22 +08:00
slirp.c net: introduce qemu_set_info_str() function 2022-10-28 13:28:52 +08:00
socket.c net: introduce qemu_set_info_str() function 2022-10-28 13:28:52 +08:00
stream.c qapi: net: add stream and dgram netdevs 2022-10-28 13:28:52 +08:00
tap_int.h net: Added SetSteeringEBPF method for NetClientState. 2021-06-04 15:25:46 +08:00
tap-bsd.c Replace fcntl(O_NONBLOCK) with g_unix_set_fd_nonblocking() 2022-05-03 15:47:38 +04:00
tap-linux.c Replace fcntl(O_NONBLOCK) with g_unix_set_fd_nonblocking() 2022-05-03 15:47:38 +04:00
tap-linux.h net/tap: Added TUNSETSTEERINGEBPF code. 2021-06-04 15:25:46 +08:00
tap-solaris.c Replace fcntl(O_NONBLOCK) with g_unix_set_fd_nonblocking() 2022-05-03 15:47:38 +04:00
tap-stub.c net: Added SetSteeringEBPF method for NetClientState. 2021-06-04 15:25:46 +08:00
tap-win32.c net: introduce qemu_set_info_str() function 2022-10-28 13:28:52 +08:00
tap.c net: introduce qemu_set_info_str() function 2022-10-28 13:28:52 +08:00
trace-events net/colo.c: Fix the pointer issue reported by Coverity. 2022-09-02 10:22:39 +08:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
util.c net: Clean up includes 2016-02-04 17:41:30 +00:00
util.h Replace config-time define HOST_WORDS_BIGENDIAN 2022-04-06 10:50:37 +02:00
vde.c net: introduce qemu_set_info_str() function 2022-10-28 13:28:52 +08:00
vhost-user-stub.c vhost-net-user: add stubs for when no virtio-net device is present 2019-02-21 12:28:01 -05:00
vhost-user.c net: introduce qemu_set_info_str() function 2022-10-28 13:28:52 +08:00
vhost-vdpa-stub.c vhost-net-vdpa: add stubs for when no virtio-net device is present 2022-07-20 16:58:08 +08:00
vhost-vdpa.c net: introduce qemu_set_info_str() function 2022-10-28 13:28:52 +08:00
vmnet_int.h net/vmnet: implement shared mode (vmnet-shared) 2022-05-17 16:48:23 +08:00
vmnet-bridged.m net/vmnet: implement bridged mode (vmnet-bridged) 2022-05-17 16:48:23 +08:00
vmnet-common.m net/vmnet: implement shared mode (vmnet-shared) 2022-05-17 16:48:23 +08:00
vmnet-host.c net/vmnet: implement host mode (vmnet-host) 2022-05-17 16:48:23 +08:00
vmnet-shared.c net/vmnet: implement shared mode (vmnet-shared) 2022-05-17 16:48:23 +08:00