[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 05/12] qapi: net: add stream and dgram netdevs
From: |
Markus Armbruster |
Subject: |
Re: [PATCH v5 05/12] qapi: net: add stream and dgram netdevs |
Date: |
Wed, 29 Jun 2022 15:49:47 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Laurent Vivier <lvivier@redhat.com> writes:
> 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 (server by default)
>
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Suggest to add a summary of what we learned during review. Let me try.
The two new types need to parsed the modern way with -netdev, because
<explanation goes here>.
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.
How do you like it?
- [PATCH v5 02/12] net: remove the @errp argument of net_client_inits(), (continued)
- [PATCH v5 02/12] net: remove the @errp argument of net_client_inits(), Laurent Vivier, 2022/06/27
- [PATCH v5 01/12] net: introduce convert_host_port(), Laurent Vivier, 2022/06/27
- [PATCH v5 03/12] net: simplify net_client_parse() error management, Laurent Vivier, 2022/06/27
- [PATCH v5 04/12] qapi: net: introduce a way to bypass qemu_opts_parse_noisily(), Laurent Vivier, 2022/06/27
- [PATCH v5 06/12] net: stream: Don't ignore EINVAL on netdev socket connection, Laurent Vivier, 2022/06/27
- [PATCH v5 05/12] qapi: net: add stream and dgram netdevs, Laurent Vivier, 2022/06/27
- [PATCH v5 07/12] net: stream: add unix socket, Laurent Vivier, 2022/06/27
- [PATCH v5 08/12] net: dgram: make dgram_dst generic, Laurent Vivier, 2022/06/27
- [PATCH v5 09/12] net: dgram: move mcast specific code from net_socket_fd_init_dgram(), Laurent Vivier, 2022/06/27
- [PATCH v5 10/12] net: dgram: add unix socket, Laurent Vivier, 2022/06/27
- [PATCH v5 11/12] qemu-sockets: introduce socket_uri(), Laurent Vivier, 2022/06/27
- [PATCH v5 12/12] net: stream: move to QIO, Laurent Vivier, 2022/06/27