mirror of https://gitee.com/openkylin/qemu.git
socket: Make errp the last parameter of socket_connect
Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <20170421122710.15373-2-famz@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
536eeea869
commit
226799cec5
|
@ -595,7 +595,7 @@ static int connect_to_sdog(BDRVSheepdogState *s, Error **errp)
|
||||||
{
|
{
|
||||||
int fd;
|
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) {
|
if (s->addr->type == SOCKET_ADDRESS_KIND_INET && fd >= 0) {
|
||||||
int ret = socket_set_nodelay(fd);
|
int ret = socket_set_nodelay(fd);
|
||||||
|
|
|
@ -45,8 +45,8 @@ int unix_listen(const char *path, char *ostr, int olen, Error **errp);
|
||||||
int unix_connect(const char *path, Error **errp);
|
int unix_connect(const char *path, Error **errp);
|
||||||
|
|
||||||
SocketAddress *socket_parse(const char *str, Error **errp);
|
SocketAddress *socket_parse(const char *str, Error **errp);
|
||||||
int socket_connect(SocketAddress *addr, Error **errp,
|
int socket_connect(SocketAddress *addr, NonBlockingConnectHandler *callback,
|
||||||
NonBlockingConnectHandler *callback, void *opaque);
|
void *opaque, Error **errp);
|
||||||
int socket_listen(SocketAddress *addr, Error **errp);
|
int socket_listen(SocketAddress *addr, Error **errp);
|
||||||
void socket_listen_cleanup(int fd, Error **errp);
|
void socket_listen_cleanup(int fd, Error **errp);
|
||||||
int socket_dgram(SocketAddress *remote, SocketAddress *local, Error **errp);
|
int socket_dgram(SocketAddress *remote, SocketAddress *local, Error **errp);
|
||||||
|
|
|
@ -140,7 +140,7 @@ int qio_channel_socket_connect_sync(QIOChannelSocket *ioc,
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
trace_qio_channel_socket_connect_sync(ioc, addr);
|
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) {
|
if (fd < 0) {
|
||||||
trace_qio_channel_socket_connect_fail(ioc);
|
trace_qio_channel_socket_connect_fail(ioc);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -578,7 +578,7 @@ static int net_socket_connect_init(NetClientState *peer,
|
||||||
goto err;
|
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) {
|
if (fd < 0) {
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1074,8 +1074,8 @@ fail:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int socket_connect(SocketAddress *addr, Error **errp,
|
int socket_connect(SocketAddress *addr, NonBlockingConnectHandler *callback,
|
||||||
NonBlockingConnectHandler *callback, void *opaque)
|
void *opaque, Error **errp)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue