From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4zJm-0008EX-Nb for qemu-devel@nongnu.org; Wed, 09 Jul 2014 17:22:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X4zJd-0006du-IF for qemu-devel@nongnu.org; Wed, 09 Jul 2014 17:22:22 -0400 Received: from mail-vc0-x235.google.com ([2607:f8b0:400c:c03::235]:40971) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4zJd-0006cV-EX for qemu-devel@nongnu.org; Wed, 09 Jul 2014 17:22:13 -0400 Received: by mail-vc0-f181.google.com with SMTP id il7so8630889vcb.12 for ; Wed, 09 Jul 2014 14:22:13 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <53BDB280.6080408@redhat.com> Date: Wed, 09 Jul 2014 23:22:08 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1404582448-23840-1-git-send-email-mreitz@redhat.com> <1404582448-23840-4-git-send-email-mreitz@redhat.com> In-Reply-To: <1404582448-23840-4-git-send-email-mreitz@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v9 03/14] qcow2: Optimize bdrv_make_empty() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi Il 05/07/2014 19:47, Max Reitz ha scritto: > bdrv_make_empty() is currently only called if the current image > represents an external snapshot that has been committed to its base > image; it is therefore unlikely to have internal snapshots. In this > case, bdrv_make_empty() can be greatly sped up by creating an empty L1 > table and dropping all data clusters at once by recreating the refcount > structure accordingly instead of normally discarding all clusters. > > If there are snapshots, fall back to the simple implementation (discard > all clusters). How much of this code could be reused by bdrv_create? Paolo