Am 10.11.2015 um 04:27 hat Max Reitz geschrieben: > Move bdrv_drain_all(), bdrv_commit_all(), bdrv_flush_all() and > bdrv_invalidate_cache_all() to BB. > > The only operation left is bdrv_close_all(), which cannot be moved to > the BB because it should not only close all BBs, but also all > monitor-owned BDSs. > > Signed-off-by: Max Reitz <mre...@redhat.com>
bdrv_commit_all() and bdrv_flush_all() are relatively obvious. They are meant to commit/flush changes made by a guest, so moving to the BB level seems right. I'm not so sure about bdrv_invalidate_cache_all(). Even if a BB isn't attached to a BDS, we still need to invalidate the caches of any images that have been opened before migration has completed, including those images that are only owned by the monitor. Similarly I'm concerned about bdrv_drain_all(). Anything outside the block layer should certainly call blk_drain_all() because it can only be interested in those images that it can see. The calls in block.c, however, look like they should consider BDSes without a BB as well. (The monitor, which can hold direct BDS references, may be another valid user of a bdrv_drain_all that also covers BDSes without a BB.) And block.c calling blk_*() functions smells a bit fishy anyway. Kevin