From da557aac181fa71fde6a2a7c7a1eb2aea20caf64 Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Fri, 20 Dec 2013 19:28:11 +0100 Subject: block: Add bdrv_open_image() Add a common function for opening images to be used for block drivers specified through BlockdevRefs in an option QDict. The difference from bdrv_file_open() is that this function may invoke bdrv_open() instead, allowing auto-detection of the driver to be used; and second, it automatically extracts the BlockdevRef from the option QDict. Signed-off-by: Max Reitz Signed-off-by: Kevin Wolf --- include/block/block.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/block') diff --git a/include/block/block.h b/include/block/block.h index e2b2a15f9a..a47f3d4988 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -186,6 +186,9 @@ int bdrv_parse_discard_flags(const char *mode, int *flags); int bdrv_file_open(BlockDriverState **pbs, const char *filename, const char *reference, QDict *options, int flags, Error **errp); +int bdrv_open_image(BlockDriverState **pbs, const char *filename, + QDict *options, const char *bdref_key, int flags, + bool force_raw, bool allow_none, Error **errp); int bdrv_open_backing_file(BlockDriverState *bs, QDict *options, Error **errp); int bdrv_open(BlockDriverState *bs, const char *filename, QDict *options, int flags, BlockDriver *drv, Error **errp); -- cgit v1.2.1