diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2009-07-02 00:19:02 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-07-16 08:28:12 -0500 |
commit | dda9b29f61b198681346191a52be417bc195b0df (patch) | |
tree | d9da45184ef32b00a2a33dad302db3fa1d824fee /vl.c | |
parent | 55ddfe8ef53f0eb01be4c9450a7f2241e745cb11 (diff) |
Add qemu_unregister_reset
Will be used by '-boot once=...', and should also help in other use
cases.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -3509,12 +3509,25 @@ void qemu_register_reset(QEMUResetHandler *func, void *opaque) TAILQ_INSERT_TAIL(&reset_handlers, re, entry); } -void qemu_system_reset(void) +void qemu_unregister_reset(QEMUResetHandler *func, void *opaque) { QEMUResetEntry *re; - /* reset all devices */ TAILQ_FOREACH(re, &reset_handlers, entry) { + if (re->func == func && re->opaque == opaque) { + TAILQ_REMOVE(&reset_handlers, re, entry); + qemu_free(re); + return; + } + } +} + +void qemu_system_reset(void) +{ + QEMUResetEntry *re, *nre; + + /* reset all devices */ + TAILQ_FOREACH_SAFE(re, &reset_handlers, entry, nre) { re->func(re->opaque); } } |