aboutsummaryrefslogtreecommitdiff
path: root/migration.c
diff options
context:
space:
mode:
authorOrit Wasserman <owasserm@redhat.com>2012-09-24 13:11:10 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2012-09-25 19:05:56 -0500
commit3202becaa2b805497ce9e6faa6edfb83665f91b1 (patch)
treec66c77db5de337b8254c310697a8b560371c462b /migration.c
parent233aa5c2d1cf4655ffe335025a68cf5454f87dad (diff)
Clear handler only for valid fd
Signed-off-by: Orit Wasserman <owasserm@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'migration.c')
-rw-r--r--migration.c4
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");