Skip to content

Commit f455492

Browse files
rth7680stsquad
authored andcommitted
plugins: Iterate on cb_lists in qemu_plugin_user_exit
Rather than iterate over all plugins for all events, iterate over plugins that have registered a given event. Signed-off-by: Richard Henderson <[email protected]> Message-Id: <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Signed-off-by: Alex Bennée <[email protected]> Message-Id: <[email protected]>
1 parent 882f5b1 commit f455492

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

plugins/core.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -514,9 +514,10 @@ void qemu_plugin_user_exit(void)
514514
/* un-register all callbacks except the final AT_EXIT one */
515515
for (ev = 0; ev < QEMU_PLUGIN_EV_MAX; ev++) {
516516
if (ev != QEMU_PLUGIN_EV_ATEXIT) {
517-
struct qemu_plugin_ctx *ctx;
518-
QTAILQ_FOREACH(ctx, &plugin.ctxs, entry) {
519-
plugin_unregister_cb__locked(ctx, ev);
517+
struct qemu_plugin_cb *cb, *next;
518+
519+
QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) {
520+
plugin_unregister_cb__locked(cb->ctx, ev);
520521
}
521522
}
522523
}

0 commit comments

Comments
 (0)