Am 29.08.2014 um 10:33 hat Hu Tao geschrieben: > This patch prepares for the subsequent patches. > > Signed-off-by: Hu Tao <hu...@cn.fujitsu.com>
> @@ -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 <kw...@redhat.com>