Received: from eggs.gnu.org ([2001:4830:134:3::10]:52006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpeTB-0006iE-BW for qemu-devel@nongnu.org; Tue, 05 May 2015 11:09:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YpeT7-0000t5-23 for qemu-devel@nongnu.org; Tue, 05 May 2015 11:09:13 -0400 From: Alberto Garcia In-Reply-To: <20150505112019.GB3866@noname.redhat.com> References: <9b9c36f8c567da1f9561828380e8aa42c08b7efd.1430388393.git.berto@igalia.com> <20150501142321.GB2386@stefanha-thinkpad.redhat.com> <20150504105813.GD3676@noname.str.redhat.com> <20150505102858.GC3149@stefanha-thinkpad.redhat.com> <20150505112019.GB3866@noname.redhat.com> Date: Tue, 05 May 2015 17:09:05 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [Qemu-block] [PATCH 1/6] qcow2: use one single memory block for the L2/refcount cache tables List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , Stefan Hajnoczi Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org, Stefan Hajnoczi On Tue 05 May 2015 01:20:19 PM CEST, Kevin Wolf wrote: > Though looking at the code again I see now that c->table_size isn't > consistently used. The I/O requests still use s->cluster_size. We > should either use it everywhere or not introduce it at all. c->table_size is necessary in order to calculate the offset of a particular table, because s->cluster_size is not always available (e.g. qcow2_cache_entry_mark_dirty()). We could make it a requirement of the API, though. Alternatively we could have c->bs instead of c->table_size. That would spare us from passing the BlockDriverState pointer to all qcow2_cache_ functions. The assumption would be that the BlockDriverState pointer is the same for the whole lifetime of the cache, but that's always guaranteed to be like that, right? Berto