diff options
author | Juan Quintela | 2009-09-01 02:12:32 +0200 |
---|---|---|
committer | Anthony Liguori | 2009-09-09 21:55:16 +0200 |
commit | bb150dc82f089c33e688694baa34a03377fcfda8 (patch) | |
tree | ad80c5e76d3df65631ecb36fb9ca0a10457cdc25 /sys-queue.h | |
parent | savevm: Convert savevm handlers list to TAILQ (diff) | |
download | qemu-bb150dc82f089c33e688694baa34a03377fcfda8.tar.gz qemu-bb150dc82f089c33e688694baa34a03377fcfda8.tar.xz qemu-bb150dc82f089c33e688694baa34a03377fcfda8.zip |
Add LIST_FOREACH_SAFE() definition
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'sys-queue.h')
-rw-r--r-- | sys-queue.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys-queue.h b/sys-queue.h index cb6a4c8906..eb89a4d217 100644 --- a/sys-queue.h +++ b/sys-queue.h @@ -126,6 +126,11 @@ struct { \ (var); \ (var) = ((var)->field.le_next)) +#define LIST_FOREACH_SAFE(var, head, field, next_var) \ + for ((var) = ((head)->lh_first); \ + (var) && ((next_var) = ((var)->field.le_next), 1); \ + (var) = (next_var)) + /* * List access methods. */ |