From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=44220 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PR3BX-0004or-AN for qemu-devel@nongnu.org; Fri, 10 Dec 2010 08:38:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PR3BT-0004LY-P3 for qemu-devel@nongnu.org; Fri, 10 Dec 2010 08:38:55 -0500 Received: from verein.lst.de ([213.95.11.210]:52553) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PR3BT-0004Ig-G4 for qemu-devel@nongnu.org; Fri, 10 Dec 2010 08:38:51 -0500 Date: Fri, 10 Dec 2010 14:38:43 +0100 From: Christoph Hellwig Subject: Re: [Qemu-devel] [PATCH 1/5] block: add discard support Message-ID: <20101210133843.GA28846@lst.de> References: <20101125135657.GA2814@lst.de> <20101201153504.GA6056@lst.de> <20101201153514.GA6310@lst.de> <4CF78D1D.3060107@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4CF78D1D.3060107@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Christoph Hellwig , qemu-devel@nongnu.org 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.