From 767db021bc45affa7a7c20ea21730d2867a0c37f Mon Sep 17 00:00:00 2001 From: Cao jin Date: Mon, 25 Jul 2016 21:02:51 +0800 Subject: [PATCH] util: Drop inet_listen() Since commit e65c67e4, inet_listen() is not used anymore, and all inet listen operation goes through QIOChannel. Cc: Daniel P. Berrange Cc: Gerd Hoffmann Cc: Paolo Bonzini Cc: Eric Blake Signed-off-by: Cao jin Message-Id: <1469451771-1173-3-git-send-email-caoj.fnst@cn.fujitsu.com> Signed-off-by: Paolo Bonzini --- include/qemu/sockets.h | 2 -- util/qemu-sockets.c | 28 ---------------------------- 2 files changed, 30 deletions(-) diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h index 28a28c0717..9eb24707df 100644 --- a/include/qemu/sockets.h +++ b/include/qemu/sockets.h @@ -33,8 +33,6 @@ int socket_set_fast_reuse(int fd); typedef void NonBlockingConnectHandler(int fd, Error *err, void *opaque); InetSocketAddress *inet_parse(const char *str, Error **errp); -int inet_listen(const char *str, char *ostr, int olen, - int socktype, int port_offset, Error **errp); int inet_connect(const char *str, Error **errp); NetworkAddressFamily inet_netfamily(int family); diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index 58f9a2cce0..2aed799e97 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -624,34 +624,6 @@ fail: return NULL; } -int inet_listen(const char *str, char *ostr, int olen, - int socktype, int port_offset, Error **errp) -{ - char *optstr; - int sock = -1; - InetSocketAddress *addr; - - addr = inet_parse(str, errp); - if (addr != NULL) { - sock = inet_listen_saddr(addr, port_offset, true, errp); - if (sock != -1 && ostr) { - optstr = strchr(str, ','); - if (addr->ipv6) { - snprintf(ostr, olen, "[%s]:%s%s", - addr->host, - addr->port, - optstr ? optstr : ""); - } else { - snprintf(ostr, olen, "%s:%s%s", - addr->host, - addr->port, - optstr ? optstr : ""); - } - } - qapi_free_InetSocketAddress(addr); - } - return sock; -} /** * Create a blocking socket and connect it to an address.