qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 1/2] add qemu_unregister_suspend_notifier
Date: Wed,  7 Mar 2012 09:52:07 +0100	[thread overview]
Message-ID: <1331110327-32520-1-git-send-email-kraxel@redhat.com> (raw)

Allow to unregister suspend notifiers.  Needed when hot-unplugging
devices.  No in-tree user (yet), but qemu-kvm needs it for pci device
assignment.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 sysemu.h |    1 +
 vl.c     |    5 +++++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/sysemu.h b/sysemu.h
index 98118cc..ef604aa 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -47,6 +47,7 @@ typedef enum WakeupReason {
 void qemu_system_reset_request(void);
 void qemu_system_suspend_request(void);
 void qemu_register_suspend_notifier(Notifier *notifier);
+void qemu_unregister_suspend_notifier(Notifier *notifier);
 void qemu_system_wakeup_request(WakeupReason reason);
 void qemu_system_wakeup_enable(WakeupReason reason, bool enabled);
 void qemu_register_wakeup_notifier(Notifier *notifier);
diff --git a/vl.c b/vl.c
index 97ab2b9..06658a8 100644
--- a/vl.c
+++ b/vl.c
@@ -1436,6 +1436,11 @@ void qemu_register_suspend_notifier(Notifier *notifier)
     notifier_list_add(&suspend_notifiers, notifier);
 }
 
+void qemu_unregister_suspend_notifier(Notifier *notifier)
+{
+    notifier_list_remove(&suspend_notifiers, notifier);
+}
+
 void qemu_system_wakeup_request(WakeupReason reason)
 {
     if (!is_suspended) {
-- 
1.7.1

                 reply	other threads:[~2012-03-07  8:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1331110327-32520-1-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).