diff options
author | Max Reitz <mreitz@redhat.com> | 2016-03-16 19:54:41 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2016-03-17 15:47:56 +0100 |
commit | 262b4e8f74dfd5ea9159aa98dcd705158b12e8ed (patch) | |
tree | 3cb4849b6f28addcc3754537f6c65e5928d64e63 /blockdev.c | |
parent | fe1a9cbc339bb54d20f1ca4c1e8788d16944d5cf (diff) | |
download | qemu-262b4e8f74dfd5ea9159aa98dcd705158b12e8ed.zip qemu-262b4e8f74dfd5ea9159aa98dcd705158b12e8ed.tar.gz qemu-262b4e8f74dfd5ea9159aa98dcd705158b12e8ed.tar.bz2 |
block: Add bdrv_next_monitor_owned()
Add a function for iterating over all monitor-owned BlockDriverStates so
the generic block layer can do so.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'blockdev.c')
-rw-r--r-- | blockdev.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -723,6 +723,13 @@ void blockdev_close_all_bdrv_states(void) } } +/* Iterates over the list of monitor-owned BlockDriverStates */ +BlockDriverState *bdrv_next_monitor_owned(BlockDriverState *bs) +{ + return bs ? QTAILQ_NEXT(bs, monitor_list) + : QTAILQ_FIRST(&monitor_bdrv_states); +} + static void qemu_opt_rename(QemuOpts *opts, const char *from, const char *to, Error **errp) { |