From nobody Tue Apr 30 04:43:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1518449388262930.6509127520546; Mon, 12 Feb 2018 07:29:48 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0A7E313AA3; Mon, 12 Feb 2018 15:29:47 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D8DD265606; Mon, 12 Feb 2018 15:29:46 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A32EB18033E1; Mon, 12 Feb 2018 15:29:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w1CFLgMf031345 for ; Mon, 12 Feb 2018 10:21:42 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8D9C7106B270; Mon, 12 Feb 2018 15:21:42 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 189DC1251BDA; Mon, 12 Feb 2018 15:21:41 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 12 Feb 2018 16:20:58 +0100 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 1/3] storage: Fix formatting and parsing of qemu type 'UnixSocketAddress' X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 12 Feb 2018 15:29:47 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The documentation for the JSON/qapi type 'UnixSocketAddress' states that the unix socket path field is named 'path'. We used 'socket' by mistake. Fix both the formatter and parser and test suite. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1544325 Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 2 +- src/util/virstoragefile.c | 2 +- tests/virstoragetest.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 585f0255ee..eb63139ca0 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -509,7 +509,7 @@ qemuBlockStorageSourceBuildJSONSocketAddress(virStorage= NetHostDefPtr host, case VIR_STORAGE_NET_HOST_TRANS_UNIX: if (virJSONValueObjectCreate(&server, "s:type", "unix", - "s:socket", host->socket, + "s:path", host->socket, NULL) < 0) goto cleanup; break; diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 7f878039ba..5705bb055b 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -2893,7 +2893,7 @@ virStorageSourceParseBackingJSONSocketAddress(virStor= ageNetHostDefPtr host, } else if (STREQ(type, "unix")) { host->transport =3D VIR_STORAGE_NET_HOST_TRANS_UNIX; - if (!(socket =3D virJSONValueObjectGetString(json, "socket"))) { + if (!(socket =3D virJSONValueObjectGetString(json, "path"))) { virReportError(VIR_ERR_INVALID_ARG, "%s", _("missing socket path for udp backing server i= n " "JSON backing volume definition")); diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 6eed7134ed..ea3d2833dd 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -1420,7 +1420,7 @@ mymain(void) "\"port\":\"1234\"" "}," "{ \"type\":\"unix\"," - "\"socket\":\"/path/= socket\"" + "\"path\":\"/path/so= cket\"" "}," "{ \"type\":\"tcp\"," "\"host\":\"example.= com\"" @@ -1441,7 +1441,7 @@ mymain(void) "\"port\":\"1234\"" "}," "{ \"type\":\"unix\"," - "\"socket\":\"/path/socke= t\"" + "\"path\":\"/path/socket\= "" "}," "{ \"type\":\"inet\"," "\"host\":\"example.com\"" --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 04:43:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1518449146926567.379047043549; Mon, 12 Feb 2018 07:25:46 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3277746279; Mon, 12 Feb 2018 15:25:45 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 155805DA5B; Mon, 12 Feb 2018 15:25:44 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id F163B4A46D; Mon, 12 Feb 2018 15:25:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w1CFLhTn031357 for ; Mon, 12 Feb 2018 10:21:43 -0500 Received: by smtp.corp.redhat.com (Postfix) id 467881227903; Mon, 12 Feb 2018 15:21:43 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id C5B08122790D; Mon, 12 Feb 2018 15:21:42 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 12 Feb 2018 16:20:59 +0100 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 2/3] virstoragetest: Add test case for NBD over unix socket with new syntax X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 12 Feb 2018 15:25:45 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Use the new syntax which uses the 'UnixSocket' type in qemu. Signed-off-by: Peter Krempa --- tests/virstoragetest.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index ea3d2833dd..87519495f0 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -1494,6 +1494,15 @@ mymain(void) "\n" " \n" "\n"); + TEST_BACKING_PARSE("json:{\"file\":{\"driver\":\"nbd\"," + "\"server\": { \"type\":\"unix\"," + "\"path\":\"/path/soc= ket\"" + "}" + "}" + "}", + "\n" + " \n" + "\n"); TEST_BACKING_PARSE("json:{\"file\":{\"driver\":\"ssh\"," "\"host\":\"example.org\"," "\"port\":\"6000\"," --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 04:43:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1518449156425288.9604118194519; Mon, 12 Feb 2018 07:25:56 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AA2B67EA97; Mon, 12 Feb 2018 15:25:54 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 32D4A4FA20; Mon, 12 Feb 2018 15:25:54 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C090F18033DF; Mon, 12 Feb 2018 15:25:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w1CFLi2D031364 for ; Mon, 12 Feb 2018 10:21:44 -0500 Received: by smtp.corp.redhat.com (Postfix) id F2F32106B270; Mon, 12 Feb 2018 15:21:43 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7E20F122790D; Mon, 12 Feb 2018 15:21:43 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 12 Feb 2018 16:21:00 +0100 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 3/3] qemu: block: Remove misleading part of comment in qemuBlockStorageSourceBuildJSONSocketAddress X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 12 Feb 2018 15:25:55 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The array indexes are formatted if the JSON->commandline translator is translating an array type. It does not at all depend on this function. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index eb63139ca0..3f37483c1e 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -472,11 +472,6 @@ qemuBlockStorageSourceGetURI(virStorageSourcePtr src) * Formats @hosts into a json object conforming to the 'SocketAddress' type * in qemu. * - * This function can be used when only 1 src->nhosts is expected in order - * to build a command without the array indices after "server.". That is - * to see "server.type", "server.host", and "server.port" instead of - * "server.#.type", "server.#.host", and "server.#.port". - * * Returns a virJSONValuePtr for a single server. */ static virJSONValuePtr --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list