aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--migration/postcopy-ram.c3
-rw-r--r--migration/qemu-file.c1
-rw-r--r--migration/ram.c4
-rw-r--r--migration/socket.c4
4 files changed, 8 insertions, 4 deletions
diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index abe8c60..9b04778 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -604,7 +604,8 @@ void *postcopy_get_tmp_page(MigrationIncomingState *mis)
mis->postcopy_tmp_page = mmap(NULL, getpagesize(),
PROT_READ | PROT_WRITE, MAP_PRIVATE |
MAP_ANONYMOUS, -1, 0);
- if (!mis->postcopy_tmp_page) {
+ if (mis->postcopy_tmp_page == MAP_FAILED) {
+ mis->postcopy_tmp_page = NULL;
error_report("%s: %s", __func__, strerror(errno));
return NULL;
}
diff --git a/migration/qemu-file.c b/migration/qemu-file.c
index bbc565e..e9fae31 100644
--- a/migration/qemu-file.c
+++ b/migration/qemu-file.c
@@ -668,6 +668,7 @@ int qemu_put_qemu_file(QEMUFile *f_des, QEMUFile *f_src)
len = f_src->buf_index;
qemu_put_buffer(f_des, f_src->buf, f_src->buf_index);
f_src->buf_index = 0;
+ f_src->iovcnt = 0;
}
return len;
}
diff --git a/migration/ram.c b/migration/ram.c
index 815bc0e..a3d70c4 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -375,8 +375,8 @@ void migrate_compress_threads_create(void)
qemu_cond_init(&comp_done_cond);
qemu_mutex_init(&comp_done_lock);
for (i = 0; i < thread_count; i++) {
- /* com_param[i].file is just used as a dummy buffer to save data, set
- * it's ops to empty.
+ /* comp_param[i].file is just used as a dummy buffer to save data,
+ * set its ops to empty.
*/
comp_param[i].file = qemu_fopen_ops(NULL, &empty_ops);
comp_param[i].done = true;
diff --git a/migration/socket.c b/migration/socket.c
index 5c0a38f..00de1fe 100644
--- a/migration/socket.c
+++ b/migration/socket.c
@@ -1,5 +1,5 @@
/*
- * QEMU live migration via Unix Domain Sockets
+ * QEMU live migration via socket
*
* Copyright Red Hat, Inc. 2009-2016
*
@@ -94,10 +94,12 @@ static void socket_start_outgoing_migration(MigrationState *s,
{
QIOChannelSocket *sioc = qio_channel_socket_new();
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);
}
+
qio_channel_socket_connect_async(sioc,
saddr,
socket_outgoing_migration,