aboutsummaryrefslogtreecommitdiff
path: root/migration
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2017-05-09 15:49:08 -0400
committerStefan Hajnoczi <stefanha@redhat.com>2017-05-09 15:49:14 -0400
commit76d20ea0f1b26ebd5da2f5fb2fdf3250cde887bb (patch)
treebcb0e4a8f29bdcfa0f5785a09608bff57a82107c /migration
parent7ed57b66221b5a3e23b3519824637b297dc92090 (diff)
parentdcd3b25d656d346205dc0f2254723fccf0264e45 (diff)
Merge remote-tracking branch 'armbru/tags/pull-qapi-2017-05-04-v3' into staging
QAPI patches for 2017-05-04 # gpg: Signature made Tue 09 May 2017 03:16:12 AM EDT # gpg: using RSA key 0x3870B400EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * armbru/tags/pull-qapi-2017-05-04-v3: (28 commits) qmp-shell: improve help qmp-shell: don't show version greeting if unavailable qmp-shell: Cope with query-commands error qmp-shell: add -N option to skip negotiate qmp-shell: add persistent command history qobject-input-visitor: Catch misuse of end_struct vs. end_list qapi: Document intended use of @name within alternate visits qobject-input-visitor: Document full_name_nth() qmp: Improve QMP dispatch error messages sockets: Delete unused helper socket_address_crumple() sockets: Limit SocketAddressLegacy to external interfaces sockets: Rename SocketAddressFlat to SocketAddress sockets: Rename SocketAddress to SocketAddressLegacy qapi: New QAPI_CLONE_MEMBERS() sockets: Prepare inet_parse() for flattened SocketAddress sockets: Prepare vsock_parse() for flattened SocketAddress test-qga: Actually test 0xff sync bytes fdc-test: Avoid deprecated 'change' command QemuOpts: Simplify qemu_opts_to_qdict() block: Simplify bdrv_append_temp_snapshot() logic ... Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r--migration/rdma.c4
-rw-r--r--migration/socket.c20
2 files changed, 11 insertions, 13 deletions
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 {
diff --git a/migration/socket.c b/migration/socket.c
index dc88812048..1cfbe81e69 100644
--- a/migration/socket.c
+++ b/migration/socket.c
@@ -27,17 +27,16 @@
static SocketAddress *tcp_build_address(const char *host_port, Error **errp)
{
- InetSocketAddress *iaddr = inet_parse(host_port, errp);
SocketAddress *saddr;
- if (!iaddr) {
+ saddr = g_new0(SocketAddress, 1);
+ saddr->type = SOCKET_ADDRESS_TYPE_INET;
+
+ if (inet_parse(&saddr->u.inet, host_port, errp)) {
+ qapi_free_SocketAddress(saddr);
return NULL;
}
- saddr = g_new0(SocketAddress, 1);
- saddr->type = SOCKET_ADDRESS_KIND_INET;
- saddr->u.inet.data = iaddr;
-
return saddr;
}
@@ -47,9 +46,8 @@ static SocketAddress *unix_build_address(const char *path)
SocketAddress *saddr;
saddr = g_new0(SocketAddress, 1);
- saddr->type = SOCKET_ADDRESS_KIND_UNIX;
- saddr->u.q_unix.data = g_new0(UnixSocketAddress, 1);
- saddr->u.q_unix.data->path = g_strdup(path);
+ saddr->type = SOCKET_ADDRESS_TYPE_UNIX;
+ saddr->u.q_unix.path = g_strdup(path);
return saddr;
}
@@ -96,8 +94,8 @@ static void socket_start_outgoing_migration(MigrationState *s,
struct SocketConnectData *data = g_new0(struct SocketConnectData, 1);
data->s = s;
- if (saddr->type == SOCKET_ADDRESS_KIND_INET) {
- data->hostname = g_strdup(saddr->u.inet.data->host);
+ if (saddr->type == SOCKET_ADDRESS_TYPE_INET) {
+ data->hostname = g_strdup(saddr->u.inet.host);
}
qio_channel_set_name(QIO_CHANNEL(sioc), "migration-socket-outgoing");