mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-29 04:52:22 -06:00
socket: Make errp the last parameter of inet_connect_saddr
Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <20170421122710.15373-3-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
226799cec5
commit
6dffc1f670
3 changed files with 9 additions and 7 deletions
|
@ -681,7 +681,7 @@ static int connect_to_ssh(BDRVSSHState *s, QDict *options,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Open the socket and connect. */
|
/* Open the socket and connect. */
|
||||||
s->sock = inet_connect_saddr(s->inet, errp, NULL, NULL);
|
s->sock = inet_connect_saddr(s->inet, NULL, NULL, errp);
|
||||||
if (s->sock < 0) {
|
if (s->sock < 0) {
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
goto err;
|
goto err;
|
||||||
|
|
|
@ -36,8 +36,9 @@ int inet_ai_family_from_address(InetSocketAddress *addr,
|
||||||
Error **errp);
|
Error **errp);
|
||||||
InetSocketAddress *inet_parse(const char *str, Error **errp);
|
InetSocketAddress *inet_parse(const char *str, Error **errp);
|
||||||
int inet_connect(const char *str, Error **errp);
|
int inet_connect(const char *str, Error **errp);
|
||||||
int inet_connect_saddr(InetSocketAddress *saddr, Error **errp,
|
int inet_connect_saddr(InetSocketAddress *saddr,
|
||||||
NonBlockingConnectHandler *callback, void *opaque);
|
NonBlockingConnectHandler *callback, void *opaque,
|
||||||
|
Error **errp);
|
||||||
|
|
||||||
NetworkAddressFamily inet_netfamily(int family);
|
NetworkAddressFamily inet_netfamily(int family);
|
||||||
|
|
||||||
|
|
|
@ -427,8 +427,9 @@ static struct addrinfo *inet_parse_connect_saddr(InetSocketAddress *saddr,
|
||||||
* function succeeds, callback will be called when the connection
|
* function succeeds, callback will be called when the connection
|
||||||
* completes, with the file descriptor on success, or -1 on error.
|
* completes, with the file descriptor on success, or -1 on error.
|
||||||
*/
|
*/
|
||||||
int inet_connect_saddr(InetSocketAddress *saddr, Error **errp,
|
int inet_connect_saddr(InetSocketAddress *saddr,
|
||||||
NonBlockingConnectHandler *callback, void *opaque)
|
NonBlockingConnectHandler *callback, void *opaque,
|
||||||
|
Error **errp)
|
||||||
{
|
{
|
||||||
Error *local_err = NULL;
|
Error *local_err = NULL;
|
||||||
struct addrinfo *res, *e;
|
struct addrinfo *res, *e;
|
||||||
|
@ -659,7 +660,7 @@ int inet_connect(const char *str, Error **errp)
|
||||||
|
|
||||||
addr = inet_parse(str, errp);
|
addr = inet_parse(str, errp);
|
||||||
if (addr != NULL) {
|
if (addr != NULL) {
|
||||||
sock = inet_connect_saddr(addr, errp, NULL, NULL);
|
sock = inet_connect_saddr(addr, NULL, NULL, errp);
|
||||||
qapi_free_InetSocketAddress(addr);
|
qapi_free_InetSocketAddress(addr);
|
||||||
}
|
}
|
||||||
return sock;
|
return sock;
|
||||||
|
@ -1081,7 +1082,7 @@ int socket_connect(SocketAddress *addr, NonBlockingConnectHandler *callback,
|
||||||
|
|
||||||
switch (addr->type) {
|
switch (addr->type) {
|
||||||
case SOCKET_ADDRESS_KIND_INET:
|
case SOCKET_ADDRESS_KIND_INET:
|
||||||
fd = inet_connect_saddr(addr->u.inet.data, errp, callback, opaque);
|
fd = inet_connect_saddr(addr->u.inet.data, callback, opaque, errp);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SOCKET_ADDRESS_KIND_UNIX:
|
case SOCKET_ADDRESS_KIND_UNIX:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue