From patchwork Wed Oct 17 19:35:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 192136 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1857E2C0097 for ; Thu, 18 Oct 2012 07:05:34 +1100 (EST) Received: from localhost ([::1]:41142 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOZP4-0002GN-Fq for incoming@patchwork.ozlabs.org; Wed, 17 Oct 2012 15:35:42 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOZOj-0001v7-9e for qemu-devel@nongnu.org; Wed, 17 Oct 2012 15:35:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOZOf-0001aP-9f for qemu-devel@nongnu.org; Wed, 17 Oct 2012 15:35:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37042) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOZOf-0001aI-2K for qemu-devel@nongnu.org; Wed, 17 Oct 2012 15:35:17 -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 q9HJZGlE012094 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 17 Oct 2012 15:35:16 -0400 Received: from localhost (ovpn-113-93.phx2.redhat.com [10.3.113.93]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q9HJZFbU001529; Wed, 17 Oct 2012 15:35:16 -0400 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Wed, 17 Oct 2012 16:35:55 -0300 Message-Id: <1350502556-4885-8-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1350502556-4885-1-git-send-email-lcapitulino@redhat.com> References: <1350502556-4885-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: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, pbonzini@redhat.com, armbru@redhat.com Subject: [Qemu-devel] [PATCH 7/8] qmp: qmp_transaction(): pass Error object to bdrv_img_create() 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 Signed-off-by: Luiz Capitulino --- blockdev.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/blockdev.c b/blockdev.c index 01be90f..af02480 100644 --- a/blockdev.c +++ b/blockdev.c @@ -701,6 +701,7 @@ void qmp_transaction(BlockdevActionList *dev_list, Error **errp) int ret = 0; BlockdevActionList *dev_entry = dev_list; BlkTransactionStates *states, *next; + Error *local_err = NULL; QSIMPLEQ_HEAD(snap_bdrv_states, BlkTransactionStates) snap_bdrv_states; QSIMPLEQ_INIT(&snap_bdrv_states); @@ -780,12 +781,12 @@ void qmp_transaction(BlockdevActionList *dev_list, Error **errp) /* create new image w/backing file */ if (mode != NEW_IMAGE_MODE_EXISTING) { - ret = bdrv_img_create(new_image_file, format, - states->old_bs->filename, - states->old_bs->drv->format_name, - NULL, -1, flags, NULL, NULL); - if (ret) { - error_set(errp, QERR_OPEN_FILE_FAILED, new_image_file); + bdrv_img_create(new_image_file, format, + states->old_bs->filename, + states->old_bs->drv->format_name, + NULL, -1, flags, NULL, &local_err); + if (error_is_set(&local_err)) { + error_propagate(errp, local_err); goto delete_and_fail; } }