From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49601 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PROu9-0000ls-DJ for qemu-devel@nongnu.org; Sat, 11 Dec 2010 07:50:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PROu8-0006UZ-6D for qemu-devel@nongnu.org; Sat, 11 Dec 2010 07:50:25 -0500 Received: from mail.codesourcery.com ([38.113.113.100]:34634) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PROu7-0006UR-SQ for qemu-devel@nongnu.org; Sat, 11 Dec 2010 07:50:24 -0500 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH 1/5] block: add discard support Date: Sat, 11 Dec 2010 12:50:20 +0000 References: <20101125135657.GA2814@lst.de> <4CF78D1D.3060107@redhat.com> <20101210133843.GA28846@lst.de> In-Reply-To: <20101210133843.GA28846@lst.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201012111250.20905.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Christoph Hellwig > On Thu, Dec 02, 2010 at 01:12:13PM +0100, Kevin Wolf wrote: > > > DEFINE_PROP_UINT16("physical_block_size", _state, > > > \ > > > > > > _conf.physical_block_size, 512), > > > \ > > > > > > DEFINE_PROP_UINT16("min_io_size", _state, _conf.min_io_size, 0), > > > \ > > > > > > - DEFINE_PROP_UINT32("opt_io_size", _state, _conf.opt_io_size, 0) > > > + DEFINE_PROP_UINT32("opt_io_size", _state, _conf.opt_io_size, 0), \ > > > + DEFINE_PROP_UINT32("discard_granularity", _state, \ > > > + _conf.discard_granularity, 0) > > > > Is there no way to get this value automatically? > > > > At least for non-raw images (and it should be trivial to implement this > > in qcow2) I guess we'll want to set it to the cluster size of the image > > instead of requiring the user to set this value. > > It's guest visible state, so it must not change due to migrations. For > the current implementation all values for it work anyway - if it's > smaller than the block size we'll zero out the remainder of the block. That sounds wrong. Surely we should leave partial blocks untouched. Paul