qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC 0/4] Allow custom socket option in socket_listen and socket_connect
@ 2018-01-29 19:13 Zihan Yang
  2018-01-29 19:13 ` [Qemu-devel] [RFC 1/4] qemu-socket: Allow custom socket option in socket_listen Zihan Yang
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Zihan Yang @ 2018-01-29 19:13 UTC (permalink / raw)
  To: qemu-devel; +Cc: Zihan Yang

socket_listen and socket_connect do not allow custom socket option.
This would be inconvenient if the caller wants a non-blocking socket,
or wants to set TCP_NODELAY or other options.

This series of patches add specific config structures, QemuSocketConfig,
which contains QemuSocketOption. All the QemuSocketOption are formed
as a linked list.

The caller is reponsible for setting up the config structure. Passing
an NULL pointer would use the original socket_listen/socket_connect,
so existing functions are not affected.

Note that the caller needs to check errno after socket_connect when
using a non-blocking socket. It does not have to in other cases.

Zihan Yang (4):
  qemu-socket: Allow custom socket option in socket_listen
  qemu-socket: Allow custom socket options in socket_connect
  net/socket: change net_socket_listen_init to use functions in
    include/qemu/sockets.h
  net/socket: change net_socket_connect_init to use functions in
    sockets.h

 block/sheepdog.c       |   2 +-
 block/ssh.c            |   2 +-
 include/qemu/sockets.h |  22 ++++++-
 io/channel-socket.c    |   4 +-
 net/socket.c           |  93 ++++++++++++++---------------
 qga/channel-posix.c    |   2 +-
 util/qemu-sockets.c    | 156 ++++++++++++++++++++++++++++++++++++++++---------
 7 files changed, 197 insertions(+), 84 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-01-31 15:28 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-29 19:13 [Qemu-devel] [RFC 0/4] Allow custom socket option in socket_listen and socket_connect Zihan Yang
2018-01-29 19:13 ` [Qemu-devel] [RFC 1/4] qemu-socket: Allow custom socket option in socket_listen Zihan Yang
2018-01-31  9:47   ` Daniel P. Berrangé
2018-01-29 19:13 ` [Qemu-devel] [RFC 2/4] qemu-socket: Allow custom socket options in socket_connect Zihan Yang
2018-01-31  9:51   ` Daniel P. Berrangé
2018-01-31 15:20     ` [Qemu-devel] Fwd: " Zihan Yang
2018-01-31 15:26       ` Daniel P. Berrangé
2018-01-29 19:13 ` [Qemu-devel] [RFC 3/4] net/socket: change net_socket_listen_init to use functions in include/qemu/sockets.h Zihan Yang
2018-01-29 19:13 ` [Qemu-devel] [RFC 4/4] net/socket: change net_socket_connect_init to use functions in sockets.h Zihan Yang
2018-01-29 19:47 ` [Qemu-devel] [RFC 0/4] Allow custom socket option in socket_listen and socket_connect no-reply
2018-01-29 20:19 ` no-reply

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).