提交 cfaf6d36 编写于 作者: J Juan Quintela 提交者: Anthony Liguori

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=518032Signed-off-by: NJuan Quintela <quintela@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 0056dcc1
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册