Skip to contentSkip to conversation

add qemu_unregister_suspend_notifier

PATCH In review Gerd Hoffmann 1 participant 1 message Mar 7, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 add qemu_unregister_suspend_notifier

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

---
 sysemu.h |    1 +
 vl.c     |    5 +++++
 2 files changed, 6 insertions(+), 0 deletions(-)
sysemu.h +1 -0
index 98118cc..ef604aa 100644
@@ -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);
vl.c +5 -0
index 97ab2b9..06658a8 100644
@@ -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) {
Signature · 1 line
1.7.1