cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
218e99
From 933ac03653bd2ec6194811b5c73b871854382298 Mon Sep 17 00:00:00 2001
218e99
From: Max Reitz <mreitz@redhat.com>
218e99
Date: Mon, 4 Nov 2013 22:32:19 +0100
218e99
Subject: [PATCH 26/87] blkverify: Employ error parameter
218e99
218e99
RH-Author: Max Reitz <mreitz@redhat.com>
218e99
Message-id: <1383604354-12743-29-git-send-email-mreitz@redhat.com>
218e99
Patchwork-id: 55328
218e99
O-Subject: [RHEL-7.0 qemu-kvm PATCH 28/43] blkverify: 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 blkverify_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 ca2884087a36c60d592aa0e8e327bf1579972077)
218e99
218e99
Signed-off-by: Max Reitz <mreitz@redhat.com>
218e99
218e99
Conflicts:
218e99
	block/blkverify.c
218e99
218e99
Conflicts because "Implement reference count for BlockDriverState" has
218e99
not yet been backported.
218e99
---
218e99
 block/blkverify.c | 11 +++++------
218e99
 1 file changed, 5 insertions(+), 6 deletions(-)
218e99
218e99
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
218e99
---
218e99
 block/blkverify.c |   11 +++++------
218e99
 1 files changed, 5 insertions(+), 6 deletions(-)
218e99
218e99
diff --git a/block/blkverify.c b/block/blkverify.c
218e99
index cceb88f..92a452d 100644
218e99
--- a/block/blkverify.c
218e99
+++ b/block/blkverify.c
218e99
@@ -128,8 +128,7 @@ static int blkverify_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
@@ -137,20 +136,21 @@ static int blkverify_open(BlockDriverState *bs, QDict *options, int flags,
218e99
     /* Parse the raw image filename */
218e99
     raw = qemu_opt_get(opts, "x-raw");
218e99
     if (raw == NULL) {
218e99
+        error_setg(errp, "Could not retrieve raw image filename");
218e99
         ret = -EINVAL;
218e99
         goto fail;
218e99
     }
218e99
 
218e99
     ret = bdrv_file_open(&bs->file, raw, 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
     /* Open the test file */
218e99
     filename = qemu_opt_get(opts, "x-image");
218e99
     if (filename == NULL) {
218e99
+        error_setg(errp, "Could not retrieve test image filename");
218e99
         ret = -EINVAL;
218e99
         goto fail;
218e99
     }
218e99
@@ -158,8 +158,7 @@ static int blkverify_open(BlockDriverState *bs, QDict *options, int flags,
218e99
     s->test_file = bdrv_new("");
218e99
     ret = bdrv_open(s->test_file, filename, NULL, flags, NULL, &local_err);
218e99
     if (ret < 0) {
218e99
-        qerror_report_err(local_err);
218e99
-        error_free(local_err);
218e99
+        error_propagate(errp, local_err);
218e99
         bdrv_delete(s->test_file);
218e99
         s->test_file = NULL;
218e99
         goto fail;
218e99
-- 
218e99
1.7.1
218e99