util/qemu-sockets: Make inet_connect_saddr() public

Make inet_connect_saddr() in util/qemu-sockets.c public in order to be
able to use it with InetSocketAddress sockets outside of
util/qemu-sockets.c independently.

Signed-off-by: Ashijeet Acharya <ashijeetacharya@gmail.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Ashijeet Acharya 2016-10-25 18:33:58 +05:30 committed by Kevin Wolf
parent 89dbe18089
commit 89cadc9dc0
2 changed files with 4 additions and 2 deletions

View File

@ -34,6 +34,8 @@ typedef void NonBlockingConnectHandler(int fd, Error *err, void *opaque);
InetSocketAddress *inet_parse(const char *str, Error **errp);
int inet_connect(const char *str, Error **errp);
int inet_connect_saddr(InetSocketAddress *saddr, Error **errp,
NonBlockingConnectHandler *callback, void *opaque);
NetworkAddressFamily inet_netfamily(int family);

View File

@ -412,8 +412,8 @@ static struct addrinfo *inet_parse_connect_saddr(InetSocketAddress *saddr,
* function succeeds, callback will be called when the connection
* completes, with the file descriptor on success, or -1 on error.
*/
static int inet_connect_saddr(InetSocketAddress *saddr, Error **errp,
NonBlockingConnectHandler *callback, void *opaque)
int inet_connect_saddr(InetSocketAddress *saddr, Error **errp,
NonBlockingConnectHandler *callback, void *opaque)
{
Error *local_err = NULL;
struct addrinfo *res, *e;