aboutsummaryrefslogtreecommitdiff
path: root/include/sysemu
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2016-01-29 16:36:13 +0100
committerMax Reitz <mreitz@redhat.com>2016-02-02 17:50:46 +0100
commitd8da3cef3bc649492d190e029343293df1386027 (patch)
tree312ba1cebe17b03320bb07613d94fb0d9c3314bd /include/sysemu
parent9c4218e957331e1ba0ba7565730b0b71c49b8d70 (diff)
block: Add blk_remove_all_bs()
When bdrv_close_all() is called, instead of force-closing all root BlockDriverStates, it is better to just drop the reference from all BlockBackends and let them be closed automatically. This prevents BDS from getting closed that are still referenced by other BDS, which may result in loss of cached data. This patch adds a function for doing that, but does not yet incorporate it in bdrv_close_all(). Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/sysemu')
-rw-r--r--include/sysemu/block-backend.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h
index ae4efb4138..ec303316bb 100644
--- a/include/sysemu/block-backend.h
+++ b/include/sysemu/block-backend.h
@@ -68,6 +68,7 @@ BlockBackend *blk_new_open(const char *name, const char *filename,
int blk_get_refcnt(BlockBackend *blk);
void blk_ref(BlockBackend *blk);
void blk_unref(BlockBackend *blk);
+void blk_remove_all_bs(void);
const char *blk_name(BlockBackend *blk);
BlockBackend *blk_by_name(const char *name);
BlockBackend *blk_next(BlockBackend *blk);