[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 14/27] gluster: Support .bdrv_co_create
From: |
Max Reitz |
Subject: |
Re: [Qemu-devel] [PATCH 14/27] gluster: Support .bdrv_co_create |
Date: |
Mon, 12 Feb 2018 15:28:42 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 |
On 2018-02-08 20:23, Kevin Wolf wrote:
> This adds the .bdrv_co_create driver callback to gluster, which enables
> image creation over QMP.
>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> qapi/block-core.json | 18 ++++++-
> block/gluster.c | 149
> +++++++++++++++++++++++++++++++++------------------
> 2 files changed, 115 insertions(+), 52 deletions(-)
[...]
> diff --git a/block/gluster.c b/block/gluster.c
> index 0f4265a3a4..b7e2b7fa2b 100644
> --- a/block/gluster.c
> +++ b/block/gluster.c
[...]
> @@ -962,64 +976,33 @@ static coroutine_fn int
> qemu_gluster_co_pwrite_zeroes(BlockDriverState *bs,
> }
> #endif
>
> -static int qemu_gluster_create(const char *filename,
> - QemuOpts *opts, Error **errp)
> +static int qemu_gluster_co_create(BlockdevCreateOptions *options,
> + Error **errp)
> {
> - BlockdevOptionsGluster *gconf;
> + BlockdevCreateOptionsGluster *opts = &options->u.gluster;
In the other drivers so far you have asserted first that options->driver
is as expected and then retrieved the appropriate part of the union. I
liked that a bit better, although of course it doesn't matter functionally.
Anyway:
Reviewed-by: Max Reitz <address@hidden>
> struct glfs *glfs;
> struct glfs_fd *fd;
> int ret = 0;
> - PreallocMode prealloc;
> - int64_t total_size = 0;
> - char *tmp = NULL;
> - Error *local_err = NULL;
> -
> - gconf = g_new0(BlockdevOptionsGluster, 1);
> - gconf->debug = qemu_opt_get_number_del(opts, GLUSTER_OPT_DEBUG,
> - GLUSTER_DEBUG_DEFAULT);
> - if (gconf->debug < 0) {
> - gconf->debug = 0;
> - } else if (gconf->debug > GLUSTER_DEBUG_MAX) {
> - gconf->debug = GLUSTER_DEBUG_MAX;
> - }
> - gconf->has_debug = true;
>
> - gconf->logfile = qemu_opt_get_del(opts, GLUSTER_OPT_LOGFILE);
> - if (!gconf->logfile) {
> - gconf->logfile = g_strdup(GLUSTER_LOGFILE_DEFAULT);
> - }
> - gconf->has_logfile = true;
> + assert(options->driver == BLOCKDEV_DRIVER_GLUSTER);
>
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH 09/27] qdict: Introduce qdict_rename_keys(), (continued)
- [Qemu-devel] [PATCH 10/27] qcow2: Use visitor for options in qcow2_create(), Kevin Wolf, 2018/02/08
- [Qemu-devel] [PATCH 11/27] block: x-blockdev-create QMP command, Kevin Wolf, 2018/02/08
- [Qemu-devel] [PATCH 13/27] file-win32: Support .bdrv_co_create, Kevin Wolf, 2018/02/08
- [Qemu-devel] [PATCH 12/27] file-posix: Support .bdrv_co_create, Kevin Wolf, 2018/02/08
- [Qemu-devel] [PATCH 14/27] gluster: Support .bdrv_co_create, Kevin Wolf, 2018/02/08
- Re: [Qemu-devel] [PATCH 14/27] gluster: Support .bdrv_co_create,
Max Reitz <=
- [Qemu-devel] [PATCH 15/27] rbd: Support .bdrv_co_create, Kevin Wolf, 2018/02/08
- [Qemu-devel] [PATCH 16/27] nfs: Use QAPI options in nfs_client_open(), Kevin Wolf, 2018/02/08
- [Qemu-devel] [PATCH 17/27] nfs: Support .bdrv_co_create, Kevin Wolf, 2018/02/08
- [Qemu-devel] [PATCH 18/27] sheepdog: QAPIfy "redundacy" create option, Kevin Wolf, 2018/02/08
- [Qemu-devel] [PATCH 19/27] sheepdog: Support .bdrv_co_create, Kevin Wolf, 2018/02/08