From patchwork Mon Jun 10 17:02:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 250329 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7BE0F2C008A for ; Tue, 11 Jun 2013 03:33:08 +1000 (EST) Received: from localhost ([::1]:54344 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Um5Xd-0004Kr-G6 for incoming@patchwork.ozlabs.org; Mon, 10 Jun 2013 13:06:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Um5UO-0000Ft-Ni for qemu-devel@nongnu.org; Mon, 10 Jun 2013 13:02:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Um5UM-0002ZK-9l for qemu-devel@nongnu.org; Mon, 10 Jun 2013 13:02:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25819) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Um5UM-0002ZC-0k for qemu-devel@nongnu.org; Mon, 10 Jun 2013 13:02:38 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5AH2bnE011420 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 10 Jun 2013 13:02:37 -0400 Received: from localhost (ovpn-113-96.phx2.redhat.com [10.3.113.96]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r5AH2auG009249; Mon, 10 Jun 2013 13:02:37 -0400 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Mon, 10 Jun 2013 13:02:27 -0400 Message-Id: <1370883748-31439-9-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1370883748-31439-1-git-send-email-lcapitulino@redhat.com> References: <1370883748-31439-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, armbru@redhat.com, stefanha@redhat.com Subject: [Qemu-devel] [PATCH 8/9] block: bdrv_reopen_prepare(): don't use QERR_OPEN_FILE_FAILED X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- block.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block.c b/block.c index 79ad33d..b88ad2f 100644 --- a/block.c +++ b/block.c @@ -1291,8 +1291,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; }