mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
block: Avoid bs->blk in bdrv_next()
We need to introduce a separate BdrvNextIterator struct that can keep more state than just the current BDS in order to avoid using the bs->blk pointer. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
parent
dde33812a8
commit
7c8eece45b
10 changed files with 103 additions and 76 deletions
|
|
@ -4135,8 +4135,9 @@ BlockJobInfoList *qmp_query_block_jobs(Error **errp)
|
|||
{
|
||||
BlockJobInfoList *head = NULL, **p_next = &head;
|
||||
BlockDriverState *bs;
|
||||
BdrvNextIterator *it = NULL;
|
||||
|
||||
for (bs = bdrv_next(NULL); bs; bs = bdrv_next(bs)) {
|
||||
while ((it = bdrv_next(it, &bs))) {
|
||||
AioContext *aio_context = bdrv_get_aio_context(bs);
|
||||
|
||||
aio_context_acquire(aio_context);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue