From cc84d90ff54c025190dbe49ec5fea1268217c5f2 Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Fri, 6 Sep 2013 17:14:26 +0200 Subject: block: Error parameter for create functions Add an Error ** parameter to bdrv_create and its associated functions to allow more specific error messages. Signed-off-by: Max Reitz --- block/raw_bsd.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'block/raw_bsd.c') diff --git a/block/raw_bsd.c b/block/raw_bsd.c index 7d75ad2..d4ace60 100644 --- a/block/raw_bsd.c +++ b/block/raw_bsd.c @@ -133,7 +133,15 @@ static int raw_has_zero_init(BlockDriverState *bs) static int raw_create(const char *filename, QEMUOptionParameter *options, Error **errp) { - return bdrv_create_file(filename, options); + Error *local_err = NULL; + int ret; + + ret = bdrv_create_file(filename, options, &local_err); + if (error_is_set(&local_err)) { + qerror_report_err(local_err); + error_free(local_err); + } + return ret; } static int raw_open(BlockDriverState *bs, QDict *options, int flags, -- cgit v1.1