]> git.proxmox.com Git - qemu.git/commitdiff
migration: Clear fd also in error cases
authorJuan Quintela <quintela@redhat.com>
Tue, 9 Mar 2010 23:10:35 +0000 (00:10 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Wed, 17 Mar 2010 16:16:15 +0000 (11:16 -0500)
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>
migration-exec.c
migration-fd.c
migration-tcp.c
migration-unix.c

index 3edc02600962c120ee9704c2e09e07d686ea32b6..6ff844927cfc3a6c210754a26d3a7d63a0c1dfdf 100644 (file)
@@ -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);
 }
 
index 0cc74ad8b20bd282fc245d0d024fe17aa4b05cea..9cf52ce90ba37bfd80aa7babf04f08fce43532d8 100644 (file)
@@ -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);
 }
 
index e7f307ce90ae1748ee02bc33c1f3bfde77474185..95ce722fecdbae933102b35f47e3744c586ae069 100644 (file)
@@ -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);
 }
 
index b7aab3843aa44138e5f6a72456692c76e4cc7d03..ce59a2a9e836bca60db32350e5ab76c30931a960 100644 (file)
@@ -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);
 }