diff options
author | Orit Wasserman <owasserm@redhat.com> | 2012-09-24 13:11:10 +0200 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2012-10-11 21:44:21 -0500 |
commit | d893e56f7249708080e2d363ce19d30a6de30733 (patch) | |
tree | d31c3c71f0b59c45dc6d7f2234e16417d0acd3eb | |
parent | 240f68ce5b9bdd13f859c80f286332036de33e6b (diff) |
Clear handler only for valid fd
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 3202becaa2b805497ce9e6faa6edfb83665f91b1)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r-- | migration.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/migration.c b/migration.c index 1edeec5ddd..22a05c437d 100644 --- a/migration.c +++ b/migration.c @@ -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"); |