]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
Revert "qemu: add a cleanup callback function to EventNotifier"
authorMichael S. Tsirkin <mst@redhat.com>
Wed, 24 Jan 2018 17:11:47 +0000 (19:11 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 24 Jan 2018 17:20:19 +0000 (19:20 +0200)
This reverts commit f87d72f5c5bff0837d409a56bd34f439a90119ca as that is
part of a patchset reported to break cleanup and migration.

Cc: Gal Hammer <ghammer@redhat.com>
Cc: Sitong Liu <siliu@redhat.com>
Cc: Xiaoling Gao <xiagao@redhat.com>
Suggested-by: Greg Kurz <groug@kaod.org>
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Reported-by: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com>
Reported-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
include/qemu/event_notifier.h
util/event_notifier-posix.c
util/event_notifier-win32.c

index b30a45474f11d4838a75917812d5abd92d5f8211..599c99f1a5ea45e29bf1249c618670425dd5fbce 100644 (file)
@@ -26,7 +26,6 @@ struct EventNotifier {
     int rfd;
     int wfd;
 #endif
-    void (*cleanup)(EventNotifier *);
 };
 
 typedef void EventNotifierHandler(EventNotifier *);
index 652566634a711293bcd89391d1c42b82a0865e82..73c4046b587184f9110fa1a1e4d6a974f3512c03 100644 (file)
@@ -29,7 +29,6 @@ void event_notifier_init_fd(EventNotifier *e, int fd)
 {
     e->rfd = fd;
     e->wfd = fd;
-    e->cleanup = NULL;
 }
 #endif
 
@@ -66,7 +65,6 @@ int event_notifier_init(EventNotifier *e, int active)
         e->rfd = fds[0];
         e->wfd = fds[1];
     }
-    e->cleanup = NULL;
     if (active) {
         event_notifier_set(e);
     }
@@ -82,11 +80,10 @@ void event_notifier_cleanup(EventNotifier *e)
 {
     if (e->rfd != e->wfd) {
         close(e->rfd);
+        e->rfd = -1;
     }
     close(e->wfd);
-    e->rfd = -1;
     e->wfd = -1;
-    e->cleanup = NULL;
 }
 
 int event_notifier_get_fd(const EventNotifier *e)
index eff86701ad951224c84891f0b240b18598600d60..62c53b0a9909af504281c5e55f749a22eff899fb 100644 (file)
@@ -19,7 +19,6 @@ int event_notifier_init(EventNotifier *e, int active)
 {
     e->event = CreateEvent(NULL, TRUE, FALSE, NULL);
     assert(e->event);
-    e->cleanup = NULL;
     return 0;
 }
 
@@ -27,7 +26,6 @@ void event_notifier_cleanup(EventNotifier *e)
 {
     CloseHandle(e->event);
     e->event = NULL;
-    e->cleanup = NULL;
 }
 
 HANDLE event_notifier_get_handle(EventNotifier *e)