qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Gal Hammer <ghammer@redhat.com>, Sitong Liu <siliu@redhat.com>,
	Xiaoling Gao <xiagao@redhat.com>, Greg Kurz <groug@kaod.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com>,
	Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>,
	Stefan Weil <sw@weilnetz.de>
Subject: [Qemu-devel] [PULL v2 3/3] Revert "qemu: add a cleanup callback function to EventNotifier"
Date: Wed, 24 Jan 2018 19:22:45 +0200	[thread overview]
Message-ID: <1516814467-25906-4-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1516814467-25906-1-git-send-email-mst@redhat.com>

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 | 1 -
 util/event_notifier-posix.c   | 5 +----
 util/event_notifier-win32.c   | 2 --
 3 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/include/qemu/event_notifier.h b/include/qemu/event_notifier.h
index b30a454..599c99f 100644
--- a/include/qemu/event_notifier.h
+++ b/include/qemu/event_notifier.h
@@ -26,7 +26,6 @@ struct EventNotifier {
     int rfd;
     int wfd;
 #endif
-    void (*cleanup)(EventNotifier *);
 };
 
 typedef void EventNotifierHandler(EventNotifier *);
diff --git a/util/event_notifier-posix.c b/util/event_notifier-posix.c
index 6525666..73c4046 100644
--- a/util/event_notifier-posix.c
+++ b/util/event_notifier-posix.c
@@ -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)
diff --git a/util/event_notifier-win32.c b/util/event_notifier-win32.c
index eff8670..62c53b0 100644
--- a/util/event_notifier-win32.c
+++ b/util/event_notifier-win32.c
@@ -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)
-- 
MST

  parent reply	other threads:[~2018-01-24 17:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24 17:22 [Qemu-devel] [PULL v2 0/3] virtio: quick fix Michael S. Tsirkin
2018-01-24 17:22 ` [Qemu-devel] [PULL v2 1/3] Revert "virtio: improve virtio devices initialization time" Michael S. Tsirkin
2018-01-24 17:22 ` [Qemu-devel] [PULL v2 2/3] Revert "virtio: postpone the execution of event_notifier_cleanup function" Michael S. Tsirkin
2018-01-24 17:22 ` Michael S. Tsirkin [this message]
2018-01-24 22:55 ` [Qemu-devel] [PULL v2 0/3] virtio: quick fix Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1516814467-25906-4-git-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=danielhb@linux.vnet.ibm.com \
    --cc=ghammer@redhat.com \
    --cc=groug@kaod.org \
    --cc=joserz@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=siliu@redhat.com \
    --cc=sw@weilnetz.de \
    --cc=xiagao@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).