From 3202becaa2b805497ce9e6faa6edfb83665f91b1 Mon Sep 17 00:00:00 2001 From: Orit Wasserman Date: Mon, 24 Sep 2012 13:11:10 +0200 Subject: Clear handler only for valid fd Signed-off-by: Orit Wasserman Signed-off-by: Anthony Liguori --- migration.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'migration.c') 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"); -- cgit v1.2.3