[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PULL 1/9] gluster: Fix blockdev-add with
From: |
Jeff Cody |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PULL 1/9] gluster: Fix blockdev-add with server.N.type=unix |
Date: |
Tue, 3 Apr 2018 17:03:43 -0400 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Tue, Apr 03, 2018 at 06:33:52PM +0200, Kevin Wolf wrote:
> The legacy command line interface gets the socket path from an option
> called 'socket'. QAPI in contract uses SocketAddress, where the
> corresponding option is called 'path'.
>
> Fix the gluster block driver to accept both 'socket' and 'path', with
> 'path' being the preferred syntax.
>
> https://bugzilla.redhat.com/show_bug.cgi?id=1545155
>
> Cc: address@hidden
> Signed-off-by: Kevin Wolf <address@hidden>
> Reviewed-by: Eric Blake <address@hidden>
Oops, you and I had a pull request collision on this patch (it is in both of
our PRs); Sorry, my fault, I didn't know you were pulling it in through your
tree.
> ---
> block/gluster.c | 21 +++++++++++++++++----
> 1 file changed, 17 insertions(+), 4 deletions(-)
>
> diff --git a/block/gluster.c b/block/gluster.c
> index 296e036b3d..4adc1a875b 100644
> --- a/block/gluster.c
> +++ b/block/gluster.c
> @@ -167,7 +167,12 @@ static QemuOptsList runtime_unix_opts = {
> {
> .name = GLUSTER_OPT_SOCKET,
> .type = QEMU_OPT_STRING,
> - .help = "socket file path)",
> + .help = "socket file path (legacy)",
> + },
> + {
> + .name = GLUSTER_OPT_PATH,
> + .type = QEMU_OPT_STRING,
> + .help = "socket file path (QAPI)",
> },
> { /* end of list */ }
> },
> @@ -615,10 +620,18 @@ static int
> qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
> goto out;
> }
>
> - ptr = qemu_opt_get(opts, GLUSTER_OPT_SOCKET);
> + ptr = qemu_opt_get(opts, GLUSTER_OPT_PATH);
> + if (!ptr) {
> + ptr = qemu_opt_get(opts, GLUSTER_OPT_SOCKET);
> + } else if (qemu_opt_get(opts, GLUSTER_OPT_SOCKET)) {
> + error_setg(&local_err,
> + "Conflicting parameters 'path' and 'socket'");
> + error_append_hint(&local_err, GERR_INDEX_HINT, i);
> + goto out;
> + }
> if (!ptr) {
> error_setg(&local_err, QERR_MISSING_PARAMETER,
> - GLUSTER_OPT_SOCKET);
> + GLUSTER_OPT_PATH);
> error_append_hint(&local_err, GERR_INDEX_HINT, i);
> goto out;
> }
> @@ -684,7 +697,7 @@ static int qemu_gluster_parse(BlockdevOptionsGluster
> *gconf,
> "file.server.0.host=1.2.3.4,"
> "file.server.0.port=24007,"
> "file.server.1.transport=unix,"
> - "file.server.1.socket=/var/run/glusterd.socket
> ..."
> + "file.server.1.path=/var/run/glusterd.socket
> ..."
> "\n");
> return ret;
> }
> --
> 2.13.6
>
>
- [Qemu-block] [PULL 0/9] Block layer patches for 2.12.0-rc2, Kevin Wolf, 2018/04/03
- [Qemu-block] [PULL 2/9] block: handle invalid lseek returns gracefully, Kevin Wolf, 2018/04/03
- [Qemu-block] [PULL 1/9] gluster: Fix blockdev-add with server.N.type=unix, Kevin Wolf, 2018/04/03
- Re: [Qemu-block] [Qemu-devel] [PULL 1/9] gluster: Fix blockdev-add with server.N.type=unix,
Jeff Cody <=
- [Qemu-block] [PULL 4/9] iotests: Update 186 after commit ac64273c66ab136c44043259162, Kevin Wolf, 2018/04/03
- [Qemu-block] [PULL 3/9] iotests: Update 051 and 186 after commit 1454509726719e0933c, Kevin Wolf, 2018/04/03
- [Qemu-block] [PULL 7/9] iotests: Test preallocated truncate of 2G image, Kevin Wolf, 2018/04/03
- [Qemu-block] [PULL 6/9] block/file-posix: Fix fully preallocated truncate, Kevin Wolf, 2018/04/03
- [Qemu-block] [PULL 8/9] qemu-iotests: Use ppc64 qemu_arch on ppc64le host, Kevin Wolf, 2018/04/03
- [Qemu-block] [PULL 9/9] iotests: Test abnormally large size in compressed cluster descriptor, Kevin Wolf, 2018/04/03
- [Qemu-block] [PULL 5/9] iotests: fix 208 for luks format, Kevin Wolf, 2018/04/03
- Re: [Qemu-block] [PULL 0/9] Block layer patches for 2.12.0-rc2, Peter Maydell, 2018/04/04