aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2009-12-11 21:01:14 +0000
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-19 08:26:20 -0600
commit55ed56908f3280f56cffe0f9659e76dcb33c19fa (patch)
treed1e80900363d3084cd4777154bc8ef2d3a4b5823 /migration-unix.c
parentFix loading of ELF multiboot kernels (diff)
downloadqemu-kvm-55ed56908f3280f56cffe0f9659e76dcb33c19fa.tar.gz
qemu-kvm-55ed56908f3280f56cffe0f9659e76dcb33c19fa.tar.bz2
qemu-kvm-55ed56908f3280f56cffe0f9659e76dcb33c19fa.zip
Avoid permanently disabled QEMU monitor when UNIX migration fails
If a UNIX migration command is attempt to a UNIX socket which does not exist, then the monitor is suspended, but never resumed. This prevents any further use of the monitor * migration-unix.c: Only call migrate_fd_monitor_suspend() once connected to the UNIX socket. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 2dd650e58acbafedc7bf34045b7f81bb6c912e72)
Diffstat (limited to 'migration-unix.c')
-rw-r--r--migration-unix.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/migration-unix.c b/migration-unix.c
index 783228b3b..a141dbbbe 100644
--- a/migration-unix.c
+++ b/migration-unix.c
@@ -112,10 +112,6 @@ MigrationState *unix_start_outgoing_migration(Monitor *mon,
socket_set_nonblock(s->fd);
- if (!detach) {
- migrate_fd_monitor_suspend(s, mon);
- }
-
do {
ret = connect(s->fd, (struct sockaddr *)&addr, sizeof(addr));
if (ret == -1)
@@ -128,7 +124,13 @@ MigrationState *unix_start_outgoing_migration(Monitor *mon,
if (ret < 0 && ret != -EINPROGRESS && ret != -EWOULDBLOCK) {
dprintf("connect failed\n");
goto err_after_open;
- } else if (ret >= 0)
+ }
+
+ if (!detach) {
+ migrate_fd_monitor_suspend(s, mon);
+ }
+
+ if (ret >= 0)
migrate_fd_connect(s);
return &s->mig_state;