From nobody Mon Dec 15 01:55:19 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1499688492507667.5209095368915; Mon, 10 Jul 2017 05:08:12 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AC4663D966; Mon, 10 Jul 2017 12:08:08 +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 7CE6117AD9; Mon, 10 Jul 2017 12:08:08 +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 312E81853E36; Mon, 10 Jul 2017 12:08:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6AC7mNc018592 for ; Mon, 10 Jul 2017 08:07:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id CFDF0182F6; Mon, 10 Jul 2017 12:07:48 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0030D182EC; Mon, 10 Jul 2017 12:07:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AC4663D966 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com AC4663D966 From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 10 Jul 2017 14:07:37 +0200 Message-Id: <44ddc8f54056b06c971159e132ed5d15a4228953.1499688409.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 05/10] qemu: command: Remove default port numbers for NBD and GLUSTER 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 10 Jul 2017 12:08:09 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The command line generators for the protocols above hardcoded a default port number. Since we now always assign it when parsing the source definition, this ad-hoc code is not required any more. --- src/qemu/qemu_command.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 285167145..10c2dea93 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -792,9 +792,6 @@ qemuBuildTLSx509CommandLine(virCommandPtr cmd, } -#define QEMU_DEFAULT_NBD_PORT "10809" -#define QEMU_DEFAULT_GLUSTER_PORT "24007" - /* builds the hosts array */ static virJSONValuePtr qemuBuildGlusterDriveJSONHosts(virStorageSourcePtr src) @@ -804,7 +801,6 @@ qemuBuildGlusterDriveJSONHosts(virStorageSourcePtr src) virJSONValuePtr ret =3D NULL; virStorageNetHostDefPtr host; const char *transport; - const char *portstr; size_t i; if (!(servers =3D virJSONValueNewArray())) @@ -813,19 +809,15 @@ qemuBuildGlusterDriveJSONHosts(virStorageSourcePtr sr= c) for (i =3D 0; i < src->nhosts; i++) { host =3D src->hosts + i; transport =3D virStorageNetHostTransportTypeToString(host->transpo= rt); - portstr =3D host->port; if (virJSONValueObjectCreate(&server, "s:type", transport, NULL) <= 0) goto cleanup; - if (!portstr) - portstr =3D QEMU_DEFAULT_GLUSTER_PORT; - switch ((virStorageNetHostTransport) host->transport) { case VIR_STORAGE_NET_HOST_TRANS_TCP: if (virJSONValueObjectAdd(server, "s:host", host->name, - "s:port", portstr, + "s:port", host->port, NULL) < 0) goto cleanup; break; @@ -979,10 +971,8 @@ qemuBuildNetworkDriveStr(virStorageSourcePtr src, switch (src->hosts->transport) { case VIR_STORAGE_NET_HOST_TRANS_TCP: - virBufferStrcat(&buf, src->hosts->name, NULL); - virBufferAsprintf(&buf, ":%s", - src->hosts->port ? src->hosts->port : - QEMU_DEFAULT_NBD_PORT); + virBufferStrcat(&buf, src->hosts->name, ":", + src->hosts->port, NULL); break; case VIR_STORAGE_NET_HOST_TRANS_UNIX: --=20 2.12.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list