On 2017-11-11 01:08, Paolo Bonzini wrote: > On 10/11/2017 18:25, Max Reitz wrote: >> if (bs) { >> + bdrv_ref(bs); >> + bdrv_unref(old_bs); >> return bs; >> } > > Maybe instead goto... > >> it->phase = BDRV_NEXT_MONITOR_OWNED; >> + } else { >> + old_bs = it->bs; >> } >> >> /* Then return the monitor-owned BDSes without a BB attached. Ignore all >> @@ -467,18 +483,46 @@ BlockDriverState *bdrv_next(BdrvNextIterator *it) >> bs = it->bs; >> } while (bs && bdrv_has_blk(bs)); > > ... here?
I wouldn't mind too much, but I don't think a goto there makes the code easier to read. Max > Paolo > >> + if (bs) { >> + bdrv_ref(bs); >> + } >> + bdrv_unref(old_bs); >> + >> return bs; >
signature.asc
Description: OpenPGP digital signature