From ce32a49212b68b1325144c61b9d1e0acebdc286c Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Mon, 4 Nov 2013 22:32:18 +0100 Subject: [PATCH 25/87] blkdebug: Employ error parameter RH-Author: Max Reitz Message-id: <1383604354-12743-28-git-send-email-mreitz@redhat.com> Patchwork-id: 55327 O-Subject: [RHEL-7.0 qemu-kvm PATCH 27/43] blkdebug: Employ error parameter Bugzilla: 1026524 RH-Acked-by: Kevin Wolf RH-Acked-by: Laszlo Ersek RH-Acked-by: Fam Zheng RH-Acked-by: Stefan Hajnoczi BZ: 1026524 Make use of the error parameter in blkdebug_open. Signed-off-by: Max Reitz Signed-off-by: Kevin Wolf (cherry picked from commit 10ffa72faed7e02805d7911d58d429efe6f95f93) Signed-off-by: Max Reitz --- block/blkdebug.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Signed-off-by: Miroslav Rezanina --- block/blkdebug.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index eda2810..9ee4fbb 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -359,8 +359,7 @@ static int blkdebug_open(BlockDriverState *bs, QDict *options, int flags, opts = qemu_opts_create_nofail(&runtime_opts); qemu_opts_absorb_qdict(opts, options, &local_err); if (error_is_set(&local_err)) { - qerror_report_err(local_err); - error_free(local_err); + error_propagate(errp, local_err); ret = -EINVAL; goto fail; } @@ -370,6 +369,7 @@ static int blkdebug_open(BlockDriverState *bs, QDict *options, int flags, if (config) { ret = read_config(s, config); if (ret < 0) { + error_setg_errno(errp, -ret, "Could not read blkdebug config file"); goto fail; } } @@ -380,14 +380,14 @@ static int blkdebug_open(BlockDriverState *bs, QDict *options, int flags, /* Open the backing file */ filename = qemu_opt_get(opts, "x-image"); if (filename == NULL) { + error_setg(errp, "Could not retrieve image file name"); ret = -EINVAL; goto fail; } ret = bdrv_file_open(&bs->file, filename, NULL, flags, &local_err); if (ret < 0) { - qerror_report_err(local_err); - error_free(local_err); + error_propagate(errp, local_err); goto fail; } -- 1.7.1