From 226799cec5fa51681a5b8c24d1bebdd735c14a8c Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Fri, 21 Apr 2017 20:26:57 +0800 Subject: [PATCH] socket: Make errp the last parameter of socket_connect Signed-off-by: Fam Zheng Message-Id: <20170421122710.15373-2-famz@redhat.com> Reviewed-by: Markus Armbruster Reviewed-by: Eric Blake Signed-off-by: Markus Armbruster --- block/sheepdog.c | 2 +- include/qemu/sockets.h | 4 ++-- io/channel-socket.c | 2 +- net/socket.c | 2 +- util/qemu-sockets.c | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index fb9203e9be..b2a5998188 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -595,7 +595,7 @@ static int connect_to_sdog(BDRVSheepdogState *s, Error **errp) { int fd; - fd = socket_connect(s->addr, errp, NULL, NULL); + fd = socket_connect(s->addr, NULL, NULL, errp); if (s->addr->type == SOCKET_ADDRESS_KIND_INET && fd >= 0) { int ret = socket_set_nodelay(fd); diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h index 7842f6d150..567eef1a91 100644 --- a/include/qemu/sockets.h +++ b/include/qemu/sockets.h @@ -45,8 +45,8 @@ int unix_listen(const char *path, char *ostr, int olen, Error **errp); int unix_connect(const char *path, Error **errp); SocketAddress *socket_parse(const char *str, Error **errp); -int socket_connect(SocketAddress *addr, Error **errp, - NonBlockingConnectHandler *callback, void *opaque); +int socket_connect(SocketAddress *addr, NonBlockingConnectHandler *callback, + void *opaque, Error **errp); int socket_listen(SocketAddress *addr, Error **errp); void socket_listen_cleanup(int fd, Error **errp); int socket_dgram(SocketAddress *remote, SocketAddress *local, Error **errp); diff --git a/io/channel-socket.c b/io/channel-socket.c index 64b36f58be..53386b7ba3 100644 --- a/io/channel-socket.c +++ b/io/channel-socket.c @@ -140,7 +140,7 @@ int qio_channel_socket_connect_sync(QIOChannelSocket *ioc, int fd; trace_qio_channel_socket_connect_sync(ioc, addr); - fd = socket_connect(addr, errp, NULL, NULL); + fd = socket_connect(addr, NULL, NULL, errp); if (fd < 0) { trace_qio_channel_socket_connect_fail(ioc); return -1; diff --git a/net/socket.c b/net/socket.c index fe3547b018..b8c931e762 100644 --- a/net/socket.c +++ b/net/socket.c @@ -578,7 +578,7 @@ static int net_socket_connect_init(NetClientState *peer, goto err; } - fd = socket_connect(c->saddr, &local_error, net_socket_connected, c); + fd = socket_connect(c->saddr, net_socket_connected, c, &local_error); if (fd < 0) { goto err; } diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index 21442c30dc..f79d3342fc 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -1074,8 +1074,8 @@ fail: return NULL; } -int socket_connect(SocketAddress *addr, Error **errp, - NonBlockingConnectHandler *callback, void *opaque) +int socket_connect(SocketAddress *addr, NonBlockingConnectHandler *callback, + void *opaque, Error **errp) { int fd;