aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2014-02-17 14:43:50 +0100
committerKevin Wolf <kwolf@redhat.com>2014-02-21 21:02:22 +0100
commitc06b72781dc6dff3f1e8209b7280ff4650eb6f36 (patch)
tree91bc0847a6e9f893894d7d3130786b6be6bb1f96
parent77e8b9ca64e85d3d309f322410964b7852ec091e (diff)
nbd: inline tcp_socket_incoming_spec into sole caller
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--include/block/nbd.h1
-rw-r--r--nbd.c8
2 files changed, 2 insertions, 7 deletions
diff --git a/include/block/nbd.h b/include/block/nbd.h
index e10ab82155..1b39c064f5 100644
--- a/include/block/nbd.h
+++ b/include/block/nbd.h
@@ -63,7 +63,6 @@ enum {
ssize_t nbd_wr_sync(int fd, void *buffer, size_t size, bool do_read);
int tcp_socket_incoming(const char *address, uint16_t port);
-int tcp_socket_incoming_spec(const char *address_and_port);
int unix_socket_outgoing(const char *path);
int unix_socket_incoming(const char *path);
diff --git a/nbd.c b/nbd.c
index 17ca95bf0d..2fc1f1fbf8 100644
--- a/nbd.c
+++ b/nbd.c
@@ -202,13 +202,9 @@ static void combine_addr(char *buf, size_t len, const char* address,
int tcp_socket_incoming(const char *address, uint16_t port)
{
char address_and_port[128];
- combine_addr(address_and_port, 128, address, port);
- return tcp_socket_incoming_spec(address_and_port);
-}
-
-int tcp_socket_incoming_spec(const char *address_and_port)
-{
Error *local_err = NULL;
+
+ combine_addr(address_and_port, 128, address, port);
int fd = inet_listen(address_and_port, NULL, 0, SOCK_STREAM, 0, &local_err);
if (local_err != NULL) {