Skip to contentSkip to conversation

add qemu_unregister_wakeup_notifier

PATCH In review Gerd Hoffmann 2 participants 2 messages Mar 7, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 add qemu_unregister_wakeup_notifier

While being at it complement qemu_register_wakeup_notifier with qemu_unregister_wakeup_notifier too.

---
 sysemu.h |    1 +
 vl.c     |    5 +++++
 2 files changed, 6 insertions(+), 0 deletions(-)
sysemu.h +1 -0
index ef604aa..031df88 100644
@@ -51,6 +51,7 @@ 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);
+void qemu_unregister_wakeup_notifier(Notifier *notifier);
 void qemu_system_shutdown_request(void);
 void qemu_system_powerdown_request(void);
 void qemu_system_debug_request(void);
vl.c +5 -0
index 06658a8..e8c4af1 100644
@@ -1470,6 +1470,11 @@ void qemu_register_wakeup_notifier(Notifier *notifier)
     notifier_list_add(&wakeup_notifiers, notifier);
 }
 
+void qemu_unregister_wakeup_notifier(Notifier *notifier)
+{
+    notifier_list_remove(&wakeup_notifiers, notifier);
+}
+
 void qemu_system_killed(int signal, pid_t pid)
 {
     shutdown_signal = signal;
Signature · 1 line
1.7.1
#1 lore raw

Il 07/03/2012 09:52, Gerd Hoffmann ha scritto:

Quoted 27 lines

While being at it complement qemu_register_wakeup_notifier with qemu_unregister_wakeup_notifier too.

---
 sysemu.h |    1 +
 vl.c     |    5 +++++
 2 files changed, 6 insertions(+), 0 deletions(-)
sysemu.h +1 -0
index ef604aa..031df88 100644
@@ -51,6 +51,7 @@ 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);
+void qemu_unregister_wakeup_notifier(Notifier *notifier);
 void qemu_system_shutdown_request(void);
 void qemu_system_powerdown_request(void);
 void qemu_system_debug_request(void);
vl.c +0 -0
index 06658a8..e8c4af1 100644
@@ -1470,6 +1470,11 @@ void qemu_register_wakeup_notifier(Notifier *notifier)
     notifier_list_add(&wakeup_notifiers, notifier);

vl.c void qemu_register_wakeup_notifier(Notifier *notifier) · line 1480

Quoted 10 lines
vl.c +5 -0
 }
 
+void qemu_unregister_wakeup_notifier(Notifier *notifier)
+{
+    notifier_list_remove(&wakeup_notifiers, notifier);
+}
+
 void qemu_system_killed(int signal, pid_t pid)
 {
     shutdown_signal = signal;

Upstream has notifier_remove, not notifier_list_remove. You could just use it directly instead of adding wrappers.

Paolo