From 0785bd7a7c58ffaf533f484cb0661671a64ecffd Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 26 Apr 2017 09:36:37 +0200 Subject: sockets: Prepare inet_parse() for flattened SocketAddress I'm going to flatten SocketAddress: rename SocketAddress to SocketAddressLegacy, SocketAddressFlat to SocketAddress, eliminate SocketAddressLegacy except in external interfaces. inet_parse() returns a newly allocated InetSocketAddress. Lift the allocation from inet_parse() into its caller socket_parse() to prepare for flattening SocketAddress. Signed-off-by: Markus Armbruster Message-Id: <1493192202-3184-3-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake [Straightforward rebase] --- migration/rdma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'migration/rdma.c') diff --git a/migration/rdma.c b/migration/rdma.c index fe0a4b5a83..7eaaf96479 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -2506,8 +2506,8 @@ static void *qemu_rdma_data_init(const char *host_port, Error **errp) rdma->current_index = -1; rdma->current_chunk = -1; - addr = inet_parse(host_port, NULL); - if (addr != NULL) { + addr = g_new(InetSocketAddress, 1); + if (!inet_parse(addr, host_port, NULL)) { rdma->port = atoi(addr->port); rdma->host = g_strdup(addr->host); } else { -- cgit v1.2.3