Received: from eggs.gnu.org ([2001:4830:134:3::10]:50421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecBSp-0005Jl-90 for qemu-devel@nongnu.org; Thu, 18 Jan 2018 09:46:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecBSm-0007jr-L0 for qemu-devel@nongnu.org; Thu, 18 Jan 2018 09:46:47 -0500 From: Alberto Garcia In-Reply-To: <65d05fd6-3ae6-ef57-7731-3f6ef99416d0@virtuozzo.com> References: <192986ad741749064e855bc67916a11460911992.1513342045.git.berto@igalia.com> <65d05fd6-3ae6-ef57-7731-3f6ef99416d0@virtuozzo.com> Date: Thu, 18 Jan 2018 15:46:39 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2 16/32] qcow2: Update l2_allocate() to support L2 slices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anton Nefedov , qemu-devel@nongnu.org Cc: Kevin Wolf , "Denis V . Lunev" , qemu-block@nongnu.org, Max Reitz On Wed 17 Jan 2018 05:57:32 PM CET, Anton Nefedov wrote: > On 17/1/2018 6:42 PM, Alberto Garcia wrote: >> On Tue 16 Jan 2018 05:52:36 PM CET, Anton Nefedov wrote: >>> >>> Cosmetic: maybe this l2_load() better be merged with the copied L2 case? >>> e.g. >>> >>> if (!(l1_table[l1_index] & COPIED)) >>> l2_allocate(); >>> l2_load(); >> >> I'm not sure about that, since there's also the qcow2_free_clusters() >> call afterwards, so the final code might be harder to follow. > > actually shouldn't qcow2_free_clusters() be done before l2_load()? > Otherwise we bail out on error and leak space. Good catch, I think that you're right. I'll fix that. Berto