From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKtEh-0004Mw-8b for qemu-devel@nongnu.org; Mon, 09 Feb 2015 13:39:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKtEb-0005ZD-38 for qemu-devel@nongnu.org; Mon, 09 Feb 2015 13:39:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36636) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKtEa-0005Yh-Rp for qemu-devel@nongnu.org; Mon, 09 Feb 2015 13:39:01 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t19Id06h032727 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 9 Feb 2015 13:39:00 -0500 From: Max Reitz Date: Mon, 9 Feb 2015 13:38:35 -0500 Message-Id: <1423507124-29809-14-git-send-email-mreitz@redhat.com> In-Reply-To: <1423507124-29809-1-git-send-email-mreitz@redhat.com> References: <1423507124-29809-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH v2 13/22] block: Add blk_commit_all() and blk_invalidate_cache_all() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Paolo Bonzini , Stefan Hajnoczi , Max Reitz These functions will be changed to iterate through the BDS trees as defined by the BlockBackends instead of the list of root BDS, therefore prepare moving their code to the BlockBackend level. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block/block-backend.c | 10 ++++++++++ include/sysemu/block-backend.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/block/block-backend.c b/block/block-backend.c index 5505bb8..3c611c1 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -1261,3 +1261,13 @@ BlockBackendRootState *blk_get_root_state(BlockBackend *blk) { return &blk->root_state; } + +int blk_commit_all(void) +{ + return bdrv_commit_all(); +} + +void blk_invalidate_cache_all(Error **errp) +{ + bdrv_invalidate_cache_all(errp); +} diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h index 1772db7..4773878 100644 --- a/include/sysemu/block-backend.h +++ b/include/sysemu/block-backend.h @@ -128,7 +128,9 @@ int blk_co_discard(BlockBackend *blk, int64_t sector_num, int nb_sectors); int blk_co_flush(BlockBackend *blk); int blk_flush(BlockBackend *blk); int blk_flush_all(void); +int blk_commit_all(void); void blk_drain_all(void); +void blk_invalidate_cache_all(Error **errp); void blk_set_on_error(BlockBackend *blk, BlockdevOnError on_read_error, BlockdevOnError on_write_error); BlockdevOnError blk_get_on_error(BlockBackend *blk, bool is_read); -- 2.1.0