[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v13 4/6] qapi: introduce PreallocMode and a new
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v13 4/6] qapi: introduce PreallocMode and a new PreallocMode full. |
Date: |
Thu, 4 Sep 2014 14:17:07 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 29.08.2014 um 10:33 hat Hu Tao geschrieben:
> This patch prepares for the subsequent patches.
>
> Signed-off-by: Hu Tao <address@hidden>
> @@ -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 <address@hidden>