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