From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3nMq-0002dY-1J for qemu-devel@nongnu.org; Tue, 01 Dec 2015 11:01:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3nMl-0000Nz-1z for qemu-devel@nongnu.org; Tue, 01 Dec 2015 11:01:23 -0500 Date: Tue, 1 Dec 2015 17:01:05 +0100 From: Kevin Wolf Message-ID: <20151201160105.GF6527@noname.str.redhat.com> References: <1447126069-6185-1-git-send-email-mreitz@redhat.com> <1447126069-6185-8-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1447126069-6185-8-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 7/8] block: Move some bdrv_*_all() functions to BB List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Stefan Hajnoczi , qemu-devel@nongnu.org, qemu-block@nongnu.org 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 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