Blob Blame History Raw
From a2ffa303cf6f0669c3810200211b4362ce2ac55e Mon Sep 17 00:00:00 2001
From: Laszlo Ersek <lersek@redhat.com>
Date: Thu, 31 Oct 2013 16:29:30 +0100
Subject: [PATCH 11/29] block: bdrv_reopen_prepare(): don't use QERR_OPEN_FILE_FAILED

RH-Author: Laszlo Ersek <lersek@redhat.com>
Message-id: <1383236971-6067-8-git-send-email-lersek@redhat.com>
Patchwork-id: 55197
O-Subject: [RHEL-7 qemu-kvm PATCH 7/8] block: bdrv_reopen_prepare(): don't use QERR_OPEN_FILE_FAILED
Bugzilla: 907743
RH-Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>

From: Luiz Capitulino <lcapitulino@redhat.com>

The call to drv->bdrv_reopen_prepare() can fail due to reasons
other than an open failure. Unfortunately, we can't use errno
nor -ret, cause they are not always set.

Stick to a generic error message then.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Acked-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit d8b6895f7a8e5bcc5be1557e8048db43882f3b33)
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 block.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 block.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/block.c b/block.c
index b160f62..2ba9a0a 100644
--- a/block.c
+++ b/block.c
@@ -1309,8 +1309,8 @@ int bdrv_reopen_prepare(BDRVReopenState *reopen_state, BlockReopenQueue *queue,
             if (local_err != NULL) {
                 error_propagate(errp, local_err);
             } else {
-                error_set(errp, QERR_OPEN_FILE_FAILED,
-                          reopen_state->bs->filename);
+                error_setg(errp, "failed while preparing to reopen image '%s'",
+                           reopen_state->bs->filename);
             }
             goto error;
         }
-- 
1.7.1