File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -599,14 +599,14 @@ BlockDriverState *bdrv_next(BdrvNextIterator *it)
599599 /* Must be called from the main loop */
600600 assert (qemu_get_current_aio_context () == qemu_get_aio_context ());
601601
602+ old_bs = it -> bs ;
603+
602604 /* First, return all root nodes of BlockBackends. In order to avoid
603605 * returning a BDS twice when multiple BBs refer to it, we only return it
604606 * if the BB is the first one in the parent list of the BDS. */
605607 if (it -> phase == BDRV_NEXT_BACKEND_ROOTS ) {
606608 BlockBackend * old_blk = it -> blk ;
607609
608- old_bs = old_blk ? blk_bs (old_blk ) : NULL ;
609-
610610 do {
611611 it -> blk = blk_all_next (it -> blk );
612612 bs = it -> blk ? blk_bs (it -> blk ) : NULL ;
@@ -620,11 +620,10 @@ BlockDriverState *bdrv_next(BdrvNextIterator *it)
620620 if (bs ) {
621621 bdrv_ref (bs );
622622 bdrv_unref (old_bs );
623+ it -> bs = bs ;
623624 return bs ;
624625 }
625626 it -> phase = BDRV_NEXT_MONITOR_OWNED ;
626- } else {
627- old_bs = it -> bs ;
628627 }
629628
630629 /* Then return the monitor-owned BDSes without a BB attached. Ignore all
You can’t perform that action at this time.
0 commit comments