From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPVya-0002uP-NK for qemu-devel@nongnu.org; Thu, 04 Sep 2014 08:17:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPVyW-0000aG-3l for qemu-devel@nongnu.org; Thu, 04 Sep 2014 08:17:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24830) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPVyV-0000a9-SU for qemu-devel@nongnu.org; Thu, 04 Sep 2014 08:17:16 -0400 Date: Thu, 4 Sep 2014 14:17:07 +0200 From: Kevin Wolf Message-ID: <20140904121707.GG3897@noname.str.redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v13 4/6] qapi: introduce PreallocMode and a new PreallocMode full. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hu Tao Cc: Fam Zheng , "Richard W.M. Jones" , qemu-devel@nongnu.org, Max Reitz , Stefan Hajnoczi , Yasunori Goto Am 29.08.2014 um 10:33 hat Hu Tao geschrieben: > This patch prepares for the subsequent patches. > > Signed-off-by: Hu Tao > @@ -1915,7 +1916,7 @@ static int qcow2_create(const char *filename, QemuOpts *opts, Error **errp) > uint64_t size = 0; > int flags = 0; > size_t cluster_size = DEFAULT_CLUSTER_SIZE; > - int prealloc = 0; > + PreallocMode prealloc = PREALLOC_MODE_OFF; > int version = 3; > Error *local_err = NULL; > int ret; The initialisation isn't really necessary any more, is it? > @@ -1958,6 +1958,13 @@ static int qcow2_create(const char *filename, QemuOpts *opts, Error **errp) > flags |= BLOCK_FLAG_LAZY_REFCOUNTS; > } > > + if (prealloc && prealloc != PREALLOC_MODE_METADATA) { > + ret = -1; > + error_setg(errp, "Unsupported preallocate mode: %s", > + PreallocMode_lookup[prealloc]); > + goto finish; > + } > + Like the other reviewers, I don't like this block much. But as it disappears later in the series and achieves it's job of maintaining bisectability: Reviewed-by: Kevin Wolf