From nobody Thu May 15 13:28:11 2025 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