mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06: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
5
qmp.c
5
qmp.c
|
@ -181,6 +181,7 @@ void qmp_cont(Error **errp)
|
|||
Error *local_err = NULL;
|
||||
BlockBackend *blk;
|
||||
BlockDriverState *bs;
|
||||
BdrvNextIterator *it;
|
||||
|
||||
/* if there is a dump in background, we should wait until the dump
|
||||
* finished */
|
||||
|
@ -199,7 +200,9 @@ void qmp_cont(Error **errp)
|
|||
for (blk = blk_next(NULL); blk; blk = blk_next(blk)) {
|
||||
blk_iostatus_reset(blk);
|
||||
}
|
||||
for (bs = bdrv_next(NULL); bs; bs = bdrv_next(bs)) {
|
||||
|
||||
it = NULL;
|
||||
while ((it = bdrv_next(it, &bs))) {
|
||||
bdrv_add_key(bs, NULL, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue