diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2014-09-09 14:12:26 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-09-10 12:08:33 +0200 |
commit | 9b10ac869d8c87024dc41f3e1a90cf7d7a64f72d (patch) | |
tree | f481aed64f403760b7dcc58a4881bac8d0d5f072 /vl.c | |
parent | fc7a5800ad13fa14529b38d2255fa87f11db626b (diff) |
vl: use QLIST_FOREACH_SAFE to visit change state handlers
This lets a handler delete itself.
Acked-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1721,11 +1721,11 @@ void qemu_del_vm_change_state_handler(VMChangeStateEntry *e) void vm_state_notify(int running, RunState state) { - VMChangeStateEntry *e; + VMChangeStateEntry *e, *next; trace_vm_state_notify(running, state); - for (e = vm_change_state_head.lh_first; e; e = e->entries.le_next) { + QLIST_FOREACH_SAFE(e, &vm_change_state_head, entries, next) { e->cb(e->opaque, running, state); } } |