Home
last modified time | relevance | path

Searched hist:e5b6353cf25c99c3f08bf51e29933352f7140e8f (Results 1 – 6 of 6) sorted by relevance

/qemu/tests/unit/
H A Dtest-util-sockets.ce5b6353cf25c99c3f08bf51e29933352f7140e8f Mon Aug 19 12:48:21 UTC 2019 Juan Quintela <quintela@redhat.com> socket: Add backlog parameter to socket_listen

Current parameter was always one. We continue with that value for now
in all callers.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
---
Moved trace to socket_listen
/qemu/qga/
H A Dchannel-posix.ce5b6353cf25c99c3f08bf51e29933352f7140e8f Mon Aug 19 12:48:21 UTC 2019 Juan Quintela <quintela@redhat.com> socket: Add backlog parameter to socket_listen

Current parameter was always one. We continue with that value for now
in all callers.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
---
Moved trace to socket_listen
/qemu/util/
H A Dtrace-eventse5b6353cf25c99c3f08bf51e29933352f7140e8f Mon Aug 19 12:48:21 UTC 2019 Juan Quintela <quintela@redhat.com> socket: Add backlog parameter to socket_listen

Current parameter was always one. We continue with that value for now
in all callers.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
---
Moved trace to socket_listen
H A Dqemu-sockets.c37179e9ea45d6428b29ae789209c119ac18c1d39 Wed Mar 10 17:30:04 UTC 2021 Stefan Hajnoczi <stefanha@redhat.com> sockets: update SOCKET_ADDRESS_TYPE_FD listen(2) backlog

socket_get_fd() fails with the error "socket_get_fd: too many
connections" if the given listen backlog value is not 1.

Not all callers set the backlog to 1. For example, commit
582d4210eb2f2ab5baac328fe4b479cd86da1647 ("qemu-nbd: Use SOMAXCONN for
socket listen() backlog") uses SOMAXCONN. This will always fail with in
socket_get_fd().

This patch calls listen(2) on the fd to update the backlog value. The
socket may already be in the listen state. I have tested that this works
on Linux 5.10 and macOS Catalina.

As a bonus this allows us to detect when the fd cannot listen. Now we'll
be able to catch unbound or connected fds in socket_listen().

Drop the num argument from socket_get_fd() since this function is also
called by socket_connect() where a listen backlog value does not make
sense.

Fixes: e5b6353cf25c99c3f08bf51e29933352f7140e8f ("socket: Add backlog parameter to socket_listen")
Reported-by: Richard W.M. Jones <rjones@redhat.com>
Cc: Juan Quintela <quintela@redhat.com>
Cc: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20210310173004.420190-1-stefanha@redhat.com>
Tested-by: Richard W.M. Jones <rjones@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
e5b6353cf25c99c3f08bf51e29933352f7140e8f Mon Aug 19 12:48:21 UTC 2019 Juan Quintela <quintela@redhat.com> socket: Add backlog parameter to socket_listen

Current parameter was always one. We continue with that value for now
in all callers.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
---
Moved trace to socket_listen
/qemu/include/qemu/
H A Dsockets.he5b6353cf25c99c3f08bf51e29933352f7140e8f Mon Aug 19 12:48:21 UTC 2019 Juan Quintela <quintela@redhat.com> socket: Add backlog parameter to socket_listen

Current parameter was always one. We continue with that value for now
in all callers.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
---
Moved trace to socket_listen
/qemu/io/
H A Dchannel-socket.ce5b6353cf25c99c3f08bf51e29933352f7140e8f Mon Aug 19 12:48:21 UTC 2019 Juan Quintela <quintela@redhat.com> socket: Add backlog parameter to socket_listen

Current parameter was always one. We continue with that value for now
in all callers.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
---
Moved trace to socket_listen