|
|
9ae3a8 |
From 96d707c999c6a64c843f0bf10c3b687ed91b92fa Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Jeffrey Cody <jcody@redhat.com>
|
|
|
9ae3a8 |
Date: Tue, 16 Sep 2014 20:11:44 +0200
|
|
|
9ae3a8 |
Subject: [PATCH 06/20] cow: correctly propagate errors
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Message-id: <974b27fc4f7aad8a056618cafcd4e31224709449.1410897407.git.jcody@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 61210
|
|
|
9ae3a8 |
O-Subject: [PATCH qemu-kvm-rhel RHEL7.1 05/15] cow: correctly propagate errors
|
|
|
9ae3a8 |
Bugzilla: 1098086
|
|
|
9ae3a8 |
RH-Acked-by: Fam Zheng <famz@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Max Reitz <mreitz@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
From: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
Reviewed-by: Fam Zheng <famz@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit f8d924e48167ec14ec4556441ec7999a30ef6640)
|
|
|
9ae3a8 |
Signed-off-by: Jeff Cody <jcody@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
block/cow.c | 8 +++-----
|
|
|
9ae3a8 |
1 files changed, 3 insertions(+), 5 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/block/cow.c b/block/cow.c
|
|
|
9ae3a8 |
index 46295d4..651bdff 100644
|
|
|
9ae3a8 |
--- a/block/cow.c
|
|
|
9ae3a8 |
+++ b/block/cow.c
|
|
|
9ae3a8 |
@@ -83,7 +83,7 @@ static int cow_open(BlockDriverState *bs, QDict *options, int flags,
|
|
|
9ae3a8 |
char version[64];
|
|
|
9ae3a8 |
snprintf(version, sizeof(version),
|
|
|
9ae3a8 |
"COW version %d", cow_header.version);
|
|
|
9ae3a8 |
- qerror_report(QERR_UNKNOWN_BLOCK_FORMAT_FEATURE,
|
|
|
9ae3a8 |
+ error_set(errp, QERR_UNKNOWN_BLOCK_FORMAT_FEATURE,
|
|
|
9ae3a8 |
bs->device_name, "cow", version);
|
|
|
9ae3a8 |
ret = -ENOTSUP;
|
|
|
9ae3a8 |
goto fail;
|
|
|
9ae3a8 |
@@ -319,15 +319,13 @@ static int cow_create(const char *filename, QEMUOptionParameter *options,
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
ret = bdrv_create_file(filename, options, &local_err);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- qerror_report_err(local_err);
|
|
|
9ae3a8 |
- error_free(local_err);
|
|
|
9ae3a8 |
+ error_propagate(errp, local_err);
|
|
|
9ae3a8 |
return ret;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
ret = bdrv_file_open(&cow_bs, filename, NULL, BDRV_O_RDWR, &local_err);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
- qerror_report_err(local_err);
|
|
|
9ae3a8 |
- error_free(local_err);
|
|
|
9ae3a8 |
+ error_propagate(errp, local_err);
|
|
|
9ae3a8 |
return ret;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.1
|
|
|
9ae3a8 |
|