mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33: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
|
@ -3427,11 +3427,13 @@ void host_net_remove_completion(ReadLineState *rs, int nb_args, const char *str)
|
|||
static void vm_completion(ReadLineState *rs, const char *str)
|
||||
{
|
||||
size_t len;
|
||||
BlockDriverState *bs = NULL;
|
||||
BlockDriverState *bs;
|
||||
BdrvNextIterator *it = NULL;
|
||||
|
||||
len = strlen(str);
|
||||
readline_set_completion_index(rs, len);
|
||||
while ((bs = bdrv_next(bs))) {
|
||||
|
||||
while ((it = bdrv_next(it, &bs))) {
|
||||
SnapshotInfoList *snapshots, *snapshot;
|
||||
AioContext *ctx = bdrv_get_aio_context(bs);
|
||||
bool ok = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue