Skip to content

Commit

Permalink
Clear handler only for valid fd
Browse files Browse the repository at this point in the history
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 3202bec)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
  • Loading branch information
oritwas authored and mdroth committed Oct 12, 2012
1 parent 240f68c commit d893e56
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion migration.c
Expand Up @@ -240,7 +240,9 @@ static int migrate_fd_cleanup(MigrationState *s)
{
int ret = 0;

qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL);
if (s->fd != -1) {
qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL);
}

if (s->file) {
DPRINTF("closing file\n");
Expand Down

0 comments on commit d893e56

Please sign in to comment.