[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 1/5] socket: Add backlog parameter to socket_
From: |
Daniel P . Berrangé |
Subject: |
Re: [Qemu-devel] [PATCH v2 1/5] socket: Add backlog parameter to socket_listen |
Date: |
Tue, 20 Aug 2019 09:39:04 +0100 |
User-agent: |
Mutt/1.12.0 (2019-05-25) |
On Tue, Aug 20, 2019 at 10:24:55AM +0200, Juan Quintela wrote:
> Current parameter was always one. We continue with that value for now
> in all callers.
>
> Signed-off-by: Juan Quintela <address@hidden>
> ---
> include/qemu/sockets.h | 2 +-
> io/channel-socket.c | 2 +-
> qga/channel-posix.c | 2 +-
> tests/test-util-sockets.c | 12 ++++++------
> util/qemu-sockets.c | 33 ++++++++++++++++++++++-----------
> util/trace-events | 2 ++
> 6 files changed, 33 insertions(+), 20 deletions(-)
>
> diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
> index e3a1666578..3f0a80404f 100644
> --- a/util/qemu-sockets.c
> +++ b/util/qemu-sockets.c
> @@ -31,6 +31,7 @@
> #include "qapi/qobject-input-visitor.h"
> #include "qapi/qobject-output-visitor.h"
> #include "qemu/cutils.h"
> +#include "trace.h"
>
> #ifndef AI_ADDRCONFIG
> # define AI_ADDRCONFIG 0
> @@ -207,6 +208,7 @@ static int try_bind(int socket, InetSocketAddress *saddr,
> struct addrinfo *e)
>
> static int inet_listen_saddr(InetSocketAddress *saddr,
> int port_offset,
> + int num,
> Error **errp)
> {
> struct addrinfo ai,*res,*e;
> @@ -309,7 +311,8 @@ static int inet_listen_saddr(InetSocketAddress *saddr,
> goto listen_failed;
> }
> } else {
> - if (!listen(slisten, 1)) {
> + trace_inet_listen_saddr(num);
It is a bit odd to only have the trace event for inet sockets. I'd
prefer it in the caller for all sockets, with just "socket_listen"
name.
> + if (!listen(slisten, num)) {
> goto listen_ok;
> }
> if (errno != EADDRINUSE) {
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- [Qemu-devel] [PATCH v2 0/5] Fix multifd with big number of channels, Juan Quintela, 2019/08/20
- [Qemu-devel] [PATCH v2 1/5] socket: Add backlog parameter to socket_listen, Juan Quintela, 2019/08/20
- Re: [Qemu-devel] [PATCH v2 1/5] socket: Add backlog parameter to socket_listen,
Daniel P . Berrangé <=
- [Qemu-devel] [PATCH v2 2/5] socket: Add num connections to qio_channel_socket_sync(), Juan Quintela, 2019/08/20
- [Qemu-devel] [PATCH v2 3/5] socket: Add num connections to qio_channel_socket_async(), Juan Quintela, 2019/08/20
- [Qemu-devel] [PATCH v2 4/5] socket: Add num connections to qio_net_listener_open_sync(), Juan Quintela, 2019/08/20
- [Qemu-devel] [PATCH v2 5/5] multifd: Use number of channels as listen backlog, Juan Quintela, 2019/08/20