From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NnUH2-0003ma-Sv for qemu-devel@nongnu.org; Fri, 05 Mar 2010 04:56:48 -0500 Received: from [199.232.76.173] (port=50638 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NnUH1-0003mS-Gr for qemu-devel@nongnu.org; Fri, 05 Mar 2010 04:56:47 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NnUH0-0003mh-RV for qemu-devel@nongnu.org; Fri, 05 Mar 2010 04:56:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:3558) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NnUH0-0003md-Fi for qemu-devel@nongnu.org; Fri, 05 Mar 2010 04:56:46 -0500 Message-ID: <4B90D528.3060901@redhat.com> Date: Fri, 05 Mar 2010 10:55:52 +0100 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] block: add logical_block_size property References: <20100304132017.GA2200@lst.de> <4B90CE3D.9070104@redhat.com> <20100305093224.GA7148@lst.de> In-Reply-To: <20100305093224.GA7148@lst.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: Christian Borntraeger , qemu-devel@nongnu.org Am 05.03.2010 10:32, schrieb Christoph Hellwig: > On Fri, Mar 05, 2010 at 10:26:21AM +0100, Kevin Wolf wrote: >> Is there a check anywhere that the user didn't give us an odd block >> size? We could get an interesting bit mask otherwise. > > Not yet. I used to have such a check in the first incarnation of > the block topology patches, but I have no idea how to do it in a > centralized way using the qdev attributs. > > Does anyone know if there's a better way to do this than just > duplicating the check in every driver? We could probably introduce a new qdev property type that says "unsigned 16 bit integer, but only powers of two", and doing this looks quite easy. On the other hand, having a new type for each possible restriction sounds a bit silly... Kevin