From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKeig-0007ex-Qt for qemu-devel@nongnu.org; Sun, 08 Feb 2015 22:09:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKeid-0000lR-Ke for qemu-devel@nongnu.org; Sun, 08 Feb 2015 22:09:06 -0500 Received: from mail-ig0-x231.google.com ([2607:f8b0:4001:c05::231]:58295) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKeid-0000lI-F7 for qemu-devel@nongnu.org; Sun, 08 Feb 2015 22:09:03 -0500 Received: by mail-ig0-f177.google.com with SMTP id z20so13643233igj.4 for ; Sun, 08 Feb 2015 19:09:02 -0800 (PST) Date: Mon, 9 Feb 2015 11:08:52 +0800 From: Liu Yuan Message-ID: <20150209030852.GA3859@ubuntu-trusty> References: <1422347727-13006-1-git-send-email-ishizaki.teruaki@lab.ntt.co.jp> <20150202065226.GB9217@ubuntu-trusty> <54D1A5FB.5060709@lab.ntt.co.jp> <20150206021100.GA19864@ubuntu-trusty> <54D47403.5070507@lab.ntt.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54D47403.5070507@lab.ntt.co.jp> Subject: Re: [Qemu-devel] [PATCH v4] sheepdog: selectable object size support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Teruaki Ishizaki Cc: kwolf@redhat.com, mitake.hitoshi@lab.ntt.co.jp, sheepdog@lists.wpkg.org, qemu-devel@nongnu.org, stefanha@redhat.com On Fri, Feb 06, 2015 at 04:57:55PM +0900, Teruaki Ishizaki wrote: > (2015/02/06 11:18), Liu Yuan wrote: > >On Wed, Feb 04, 2015 at 01:54:19PM +0900, Teruaki Ishizaki wrote: > >>(2015/02/02 15:52), Liu Yuan wrote: > >>>On Tue, Jan 27, 2015 at 05:35:27PM +0900, Teruaki Ishizaki wrote: > >>>>Previously, qemu block driver of sheepdog used hard-coded VDI object size. > >>>>This patch enables users to handle "block_size_shift" value for > >>>>calculating VDI object size. > >>>> > >>>>When you start qemu, you don't need to specify additional command option. > >>>> > >>>>But when you create the VDI which doesn't have default object size > >>>>with qemu-img command, you specify block_size_shift option. > >>>> > >>>>If you want to create a VDI of 8MB(1 << 23) object size, > >>>>you need to specify following command option. > >>>> > >>>> # qemu-img create -o block_size_shift=23 sheepdog:test1 100M > >>> > >>>Is it possible to make this option more user friendly? such as > >>> > >>> $ qemu-img create -o object_size=8M sheepdog:test 1G > >> > >>At first, I thought that the object_size was user friendly. > >>But, Sheepdog has already the value of block_size_shift > >>in the inode layout that means like object_size. > >> > >>'object_size' doesn't always fit right in 'block_size_shift'. > >>On the other hands, 'block_size_shift' always fit right in > >>'object_size'. > >> > >>I think that existing layout shouldn't be changed easily and > >>it seems that it is difficult for users to specify > >>the object_size value that fit right in 'block_size_shift'. > > > >I don't think we need to change the layout. block_size_shift is what QEMU talks > >to sheep, and QEMU options is what users talks to QEMU. We can convert the user > >friendly object size into block_size_shift internally in the driver before > >sending it tosheep daemon, no? > > > For example, users specify 12MB for object size, block_size_shift > doesn't fit exactly to an integer. In this case, we should abort and print the error message and notify the users the acceptable range like erasure coding option. > > I suppose that normally an administrator do format sheepdog cluster > with specifying block_size_shift and users usually do qemu-img command > without a block_size_shift option. block_size_shift is too developer centered and has a direct relation to the underlying algorithm. If in the future, e.g, we change the underlying algorithm about how we represent block size, block_size_shift might not even exsit. So use object_size would be more generic and won't have this kind of problem. Secondly, it is not hard to parse the object_size into block_size_shift, so I'd suggest we'd better try our best to make it user friendly. Thanks Yuan