From: Orit Wasserman Date: Mon, 24 Sep 2012 11:11:10 +0000 (+0200) Subject: Clear handler only for valid fd X-Git-Tag: qemu-xen-4.3.0-rc1~444 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=3202becaa2b805497ce9e6faa6edfb83665f91b1;p=qemu-upstream-unstable.git Clear handler only for valid fd Signed-off-by: Orit Wasserman Signed-off-by: Anthony Liguori --- diff --git a/migration.c b/migration.c index 1edeec5dd..22a05c437 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");