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 <[email protected]>
> ---
> 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 :|