add qemu_unregister_wakeup_notifier
PATCH 2/2 add qemu_unregister_wakeup_notifier
While being at it complement qemu_register_wakeup_notifier with qemu_unregister_wakeup_notifier too.
Signed-off-by Gerd Hoffmann <[email protected]>
--- sysemu.h | 1 + vl.c | 5 +++++ 2 files changed, 6 insertions(+), 0 deletions(-)
sysemu.h +1 -0
@@ -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
@@ -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
Il 07/03/2012 09:52, Gerd Hoffmann ha scritto:
Quoted 27 lines
While being at it complement
qemu_register_wakeup_notifierwithqemu_unregister_wakeup_notifiertoo.Signed-off-by Gerd Hoffmann <[email protected]>--- sysemu.h | 1 + vl.c | 5 +++++ 2 files changed, 6 insertions(+), 0 deletions(-)sysemu.h +1
-0@@ -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@@ -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