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