From nobody Sat Feb 7 07:11:23 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522772156657233.19264747365207; Tue, 3 Apr 2018 09:15:56 -0700 (PDT) Received: from localhost ([::1]:46089 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3ObD-0005XH-K9 for importer@patchew.org; Tue, 03 Apr 2018 12:15:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50270) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3OZ6-00044b-B3 for qemu-devel@nongnu.org; Tue, 03 Apr 2018 12:13:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3OZ5-0005Fr-B1 for qemu-devel@nongnu.org; Tue, 03 Apr 2018 12:13:44 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:45756 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3OZ0-0005DJ-Ve; Tue, 03 Apr 2018 12:13:39 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9D217EB700; Tue, 3 Apr 2018 16:13:38 +0000 (UTC) Received: from localhost (ovpn-121-230.rdu2.redhat.com [10.10.121.230]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 29971215CDAF; Tue, 3 Apr 2018 16:13:38 +0000 (UTC) From: Jeff Cody To: qemu-block@nongnu.org Date: Tue, 3 Apr 2018 12:13:24 -0400 Message-Id: <20180403161324.24514-4-jcody@redhat.com> In-Reply-To: <20180403161324.24514-1-jcody@redhat.com> References: <20180403161324.24514-1-jcody@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 03 Apr 2018 16:13:38 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 03 Apr 2018 16:13:38 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jcody@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 3/3] gluster: Fix blockdev-add with server.N.type=unix X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , peter.maydell@linaro.org, jcody@redhat.com, qemu-stable@nongnu.org, qemu-devel@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Kevin Wolf 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=3D1545155 Cc: qemu-stable@nongnu.org Signed-off-by: Kevin Wolf Message-id: 20180403110810.25624-1-kwolf@redhat.com Signed-off-by: Jeff Cody --- 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 =3D { { .name =3D GLUSTER_OPT_SOCKET, .type =3D QEMU_OPT_STRING, - .help =3D "socket file path)", + .help =3D "socket file path (legacy)", + }, + { + .name =3D GLUSTER_OPT_PATH, + .type =3D QEMU_OPT_STRING, + .help =3D "socket file path (QAPI)", }, { /* end of list */ } }, @@ -615,10 +620,18 @@ static int qemu_gluster_parse_json(BlockdevOptionsGlu= ster *gconf, goto out; } =20 - ptr =3D qemu_opt_get(opts, GLUSTER_OPT_SOCKET); + ptr =3D qemu_opt_get(opts, GLUSTER_OPT_PATH); + if (!ptr) { + ptr =3D 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 *g= conf, "file.server.0.host=3D1.2.3.4," "file.server.0.port=3D24007," "file.server.1.transport=3Dunix," - "file.server.1.socket=3D/var/run/glusterd.soc= ket ..." + "file.server.1.path=3D/var/run/glusterd.socke= t ..." "\n"); return ret; } --=20 2.13.6