aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2010-03-10 00:10:35 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2010-03-17 11:16:15 -0500
commitcfaf6d36ae761da1033159d85d670706ffb24fb9 (patch)
treea5165f1ba834d1478cf407fd9d66dd1efb0dcc7c
parent0056dcc1146545e7c814db83b7b7b62e0c93ac68 (diff)
downloadqemu-arm-cfaf6d36ae761da1033159d85d670706ffb24fb9.tar.gz
migration: Clear fd also in error cases
Not clearing the fd and closing the file makes qemu spin using 100%CPU after incoming migration error. See for instance bug: https://bugzilla.redhat.com/show_bug.cgi?id=518032 Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r--migration-exec.c4
-rw-r--r--migration-fd.c4
-rw-r--r--migration-tcp.c5
-rw-r--r--migration-unix.c5
4 files changed, 8 insertions, 10 deletions
diff --git a/migration-exec.c b/migration-exec.c
index 3edc026009..6ff844927c 100644
--- a/migration-exec.c
+++ b/migration-exec.c
@@ -120,12 +120,12 @@ static void exec_accept_incoming_migration(void *opaque)
}
qemu_announce_self();
DPRINTF("successfully loaded vm state\n");
- /* we've successfully migrated, close the fd */
- qemu_set_fd_handler2(qemu_stdio_fd(f), NULL, NULL, NULL, NULL);
+
if (autostart)
vm_start();
err:
+ qemu_set_fd_handler2(qemu_stdio_fd(f), NULL, NULL, NULL, NULL);
qemu_fclose(f);
}
diff --git a/migration-fd.c b/migration-fd.c
index 0cc74ad8b2..9cf52ce90b 100644
--- a/migration-fd.c
+++ b/migration-fd.c
@@ -113,12 +113,12 @@ static void fd_accept_incoming_migration(void *opaque)
}
qemu_announce_self();
DPRINTF("successfully loaded vm state\n");
- /* we've successfully migrated, close the fd */
- qemu_set_fd_handler2(qemu_stdio_fd(f), NULL, NULL, NULL, NULL);
+
if (autostart)
vm_start();
err:
+ qemu_set_fd_handler2(qemu_stdio_fd(f), NULL, NULL, NULL, NULL);
qemu_fclose(f);
}
diff --git a/migration-tcp.c b/migration-tcp.c
index e7f307ce90..95ce722fec 100644
--- a/migration-tcp.c
+++ b/migration-tcp.c
@@ -170,15 +170,14 @@ static void tcp_accept_incoming_migration(void *opaque)
qemu_announce_self();
DPRINTF("successfully loaded vm state\n");
- /* we've successfully migrated, close the server socket */
- qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL);
- close(s);
if (autostart)
vm_start();
out_fopen:
qemu_fclose(f);
out:
+ qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL);
+ close(s);
close(c);
}
diff --git a/migration-unix.c b/migration-unix.c
index b7aab3843a..ce59a2a9e8 100644
--- a/migration-unix.c
+++ b/migration-unix.c
@@ -176,13 +176,12 @@ static void unix_accept_incoming_migration(void *opaque)
qemu_announce_self();
DPRINTF("successfully loaded vm state\n");
- /* we've successfully migrated, close the server socket */
- qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL);
- close(s);
out_fopen:
qemu_fclose(f);
out:
+ qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL);
+ close(s);
close(c);
}