peterdelevoryas / rpms / qemu

Forked from rpms/qemu 2 years ago
Clone

Blame 0235-Clear-handler-only-for-valid-fd.patch

5544c1
From b7b94b6016b89bf698d661ce4fd22139e771a835 Mon Sep 17 00:00:00 2001
5544c1
From: Orit Wasserman <owasserm@redhat.com>
5544c1
Date: Mon, 24 Sep 2012 13:11:10 +0200
5544c1
Subject: [PATCH] Clear handler only for valid fd
5544c1
5544c1
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
5544c1
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
5544c1
(cherry picked from commit 3202becaa2b805497ce9e6faa6edfb83665f91b1)
5544c1
5544c1
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
5544c1
---
5544c1
 migration.c | 4 +++-
5544c1
 1 file changed, 3 insertions(+), 1 deletion(-)
5544c1
5544c1
diff --git a/migration.c b/migration.c
5544c1
index 1edeec5..22a05c4 100644
5544c1
--- a/migration.c
5544c1
+++ b/migration.c
5544c1
@@ -240,7 +240,9 @@ static int migrate_fd_cleanup(MigrationState *s)
5544c1
 {
5544c1
     int ret = 0;
5544c1
 
5544c1
-    qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL);
5544c1
+    if (s->fd != -1) {
5544c1
+        qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL);
5544c1
+    }
5544c1
 
5544c1
     if (s->file) {
5544c1
         DPRINTF("closing file\n");
5544c1
-- 
5544c1
1.7.12.1
5544c1