qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH v2 7/8] block: Move some bdrv_*_all() functions


From: Kevin Wolf
Subject: Re: [Qemu-block] [PATCH v2 7/8] block: Move some bdrv_*_all() functions to BB
Date: Tue, 1 Dec 2015 17:01:05 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

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 <address@hidden>

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]