From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNXw8-00045W-Fd for qemu-devel@nongnu.org; Sat, 21 Sep 2013 20:54:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VNXw2-0008D3-CC for qemu-devel@nongnu.org; Sat, 21 Sep 2013 20:54:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58002) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNXw2-0008Cw-41 for qemu-devel@nongnu.org; Sat, 21 Sep 2013 20:54:02 -0400 Date: Sun, 22 Sep 2013 08:53:56 +0800 From: Fam Zheng Message-ID: <20130922005356.GA2985@T430s.nay.redhat.com> References: <1379502855-27759-1-git-send-email-famz@redhat.com> <1379502855-27759-3-git-send-email-famz@redhat.com> <20130919113102.GG22814@stefanha-thinkpad.redhat.com> <523C6401.3020509@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <523C6401.3020509@redhat.com> Subject: Re: [Qemu-devel] [PATCH 2/2] vmdk: fix cluster size check for flat extents Reply-To: famz@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , stefanha@redhat.com Cc: kwolf@redhat.com, Stefan Hajnoczi , asias@redhat.com, qemu-devel@nongnu.org On Fri, 09/20 17:04, Paolo Bonzini wrote: > Il 19/09/2013 13:31, Stefan Hajnoczi ha scritto: > >> > We use the extent size as cluster size for flat extents (where no L1/L2 > >> > table is allocated so it's safe). > > Why is the extent size passed as the cluster size parameter? > > I think it's so that the flat extent doesn't take up too many cache entries. > > Paolo Flat extent doesn't take cache entry at all. It's passed as this because so that more the code path for finding data offset can be the same with sparse: flat is a special case of sparse with only 1 cluster. Otherwize flat needs to be treated specially. Another fix would be pass zero to cluster size parameter but initialize it to extent size after parameter checking. But not quite different. Fam