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