mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
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 <armbru@redhat.com> Message-Id: <1493192202-3184-3-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [Straightforward rebase]
This commit is contained in:
parent
4db5c619a2
commit
0785bd7a7c
5 changed files with 22 additions and 27 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue