From cfaf6d36ae761da1033159d85d670706ffb24fb9 Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Wed, 10 Mar 2010 00:10:35 +0100 Subject: 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 Signed-off-by: Anthony Liguori --- migration-tcp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'migration-tcp.c') 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); } -- cgit v1.2.1