yeahuh / rpms / qemu-kvm

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