From patchwork Wed Oct 22 08:08:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Max Reitz X-Patchwork-Id: 401917 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1B6BA140076 for ; Wed, 22 Oct 2014 19:12:02 +1100 (AEDT) Received: from localhost ([::1]:55349 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xgr1U-0005bW-24 for incoming@patchwork.ozlabs.org; Wed, 22 Oct 2014 04:12:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44356) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xgqya-0000oz-JE for qemu-devel@nongnu.org; Wed, 22 Oct 2014 04:09:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XgqyV-00045o-8h for qemu-devel@nongnu.org; Wed, 22 Oct 2014 04:09:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56388) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgqyV-00045i-1U for qemu-devel@nongnu.org; Wed, 22 Oct 2014 04:08:55 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9M88qtR030308 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 22 Oct 2014 04:08:52 -0400 Received: from localhost (dhcp-192-247.str.redhat.com [10.33.192.247]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9M88pEx024412 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Wed, 22 Oct 2014 04:08:52 -0400 From: Max Reitz To: qemu-devel@nongnu.org Date: Wed, 22 Oct 2014 10:08:34 +0200 Message-Id: <1413965324-14541-4-git-send-email-mreitz@redhat.com> In-Reply-To: <1413965324-14541-1-git-send-email-mreitz@redhat.com> References: <1413965324-14541-1-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id s9M88qtR030308 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Kevin Wolf , =?UTF-8?q?Beno=C3=AEt=20Canet?= , Stefan Hajnoczi , Max Reitz Subject: [Qemu-devel] [PATCH v7 03/13] qcow2: Fix leaks in dirty images 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 When opening dirty images, qcow2's repair function should not only repair errors but leaks as well. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: BenoƮt Canet Reviewed-by: Kevin Wolf --- block/qcow2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/qcow2.c b/block/qcow2.c index 3c8b881..7a2c66f 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -910,7 +910,7 @@ static int qcow2_open(BlockDriverState *bs, QDict *options, int flags, (s->incompatible_features & QCOW2_INCOMPAT_DIRTY)) { BdrvCheckResult result = {0}; - ret = qcow2_check(bs, &result, BDRV_FIX_ERRORS); + ret = qcow2_check(bs, &result, BDRV_FIX_ERRORS | BDRV_FIX_LEAKS); if (ret < 0) { error_setg_errno(errp, -ret, "Could not repair dirty image"); goto fail;