From patchwork Wed May 15 08:43:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wayne Xia X-Patchwork-Id: 243945 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 846732C008C for ; Wed, 15 May 2013 18:47:18 +1000 (EST) Received: from localhost ([::1]:35897 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcXMi-0006u0-PR for incoming@patchwork.ozlabs.org; Wed, 15 May 2013 04:47:16 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcXLq-00062a-3g for qemu-devel@nongnu.org; Wed, 15 May 2013 04:46:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UcXLp-00040M-07 for qemu-devel@nongnu.org; Wed, 15 May 2013 04:46:21 -0400 Received: from e28smtp07.in.ibm.com ([122.248.162.7]:50834) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcXLo-0003zn-Cp for qemu-devel@nongnu.org; Wed, 15 May 2013 04:46:20 -0400 Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 15 May 2013 14:10:36 +0530 Received: from d28dlp01.in.ibm.com (9.184.220.126) by e28smtp07.in.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 15 May 2013 14:10:34 +0530 Received: from d28relay01.in.ibm.com (d28relay01.in.ibm.com [9.184.220.58]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id 189EBE004C for ; Wed, 15 May 2013 14:18:40 +0530 (IST) Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r4F8j8fh59703512 for ; Wed, 15 May 2013 14:15:09 +0530 Received: from d28av03.in.ibm.com (loopback [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r4F8jFxE010900 for ; Wed, 15 May 2013 18:45:15 +1000 Received: from RH63Wenchao (wenchaox.cn.ibm.com [9.115.122.120]) by d28av03.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r4F8hjIT003740; Wed, 15 May 2013 18:45:13 +1000 From: Wenchao Xia To: qemu-devel@nongnu.org Date: Wed, 15 May 2013 16:43:38 +0800 Message-Id: <1368607419-15178-1-git-send-email-xiawenc@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13051508-8878-0000-0000-0000071D7E51 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 122.248.162.7 Cc: kwolf@redhat.com, pbonzini@redhat.com, aliguori@us.ibm.com, Wenchao Xia , stefanha@gmail.com Subject: [Qemu-devel] [PATCH 1/2] qcow2: free allocated cluster on fail in qcow2_write_snapshots() 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: Wenchao Xia --- block/qcow2-snapshot.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c index 992a5c8..a6065a9 100644 --- a/block/qcow2-snapshot.c +++ b/block/qcow2-snapshot.c @@ -268,6 +268,8 @@ static int qcow2_write_snapshots(BlockDriverState *bs) return 0; fail: + /* free the new snapshot table */ + qcow2_free_clusters(bs, snapshots_offset, snapshots_size); return ret; }