[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/9] block: Add blk_commit_all() and blk_invalidate_
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH 3/9] block: Add blk_commit_all() and blk_invalidate_cache_all() |
Date: |
Tue, 24 Feb 2015 11:23:14 -0500 |
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 <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
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 ab3affa..2550ee0 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -1251,3 +1251,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 8b4a9ec..2400a7e 100644
--- a/include/sysemu/block-backend.h
+++ b/include/sysemu/block-backend.h
@@ -126,7 +126,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
- [Qemu-devel] [PATCH 0/9] blockdev: Further BlockBackend work, Max Reitz, 2015/02/24
- [Qemu-devel] [PATCH 7/9] block: Make bdrv_drain_one() public, Max Reitz, 2015/02/24
- [Qemu-devel] [PATCH 5/9] blockdev: Add list of monitor-owned BlockBackends, Max Reitz, 2015/02/24
- [Qemu-devel] [PATCH 1/9] block: Add blk_name_taken(), Max Reitz, 2015/02/24
- [Qemu-devel] [PATCH 9/9] block: Remove bdrv_states, Max Reitz, 2015/02/24
- [Qemu-devel] [PATCH 6/9] blockdev: Remove blk_hide_on_behalf_of_do_drive_del(), Max Reitz, 2015/02/24
- [Qemu-devel] [PATCH 2/9] block: Add blk_next_inserted(), Max Reitz, 2015/02/24
- [Qemu-devel] [PATCH 3/9] block: Add blk_commit_all() and blk_invalidate_cache_all(),
Max Reitz <=
- [Qemu-devel] [PATCH 8/9] block: Move some bdrv_*_all() functions to BB, Max Reitz, 2015/02/24
- [Qemu-devel] [PATCH 4/9] block: Use BlockBackend more, Max Reitz, 2015/02/24