From nobody Tue Feb 10 15:29:50 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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1512152577346131.05423058252597; Fri, 1 Dec 2017 10:22:57 -0800 (PST) Received: from localhost ([::1]:59426 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKpxZ-0001Ru-3l for importer@patchew.org; Fri, 01 Dec 2017 13:22:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKoGg-0002ca-5p for qemu-devel@nongnu.org; Fri, 01 Dec 2017 11:34:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKoGb-00012o-5e for qemu-devel@nongnu.org; Fri, 01 Dec 2017 11:34:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60506) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eKoGa-00011r-QU for qemu-devel@nongnu.org; Fri, 01 Dec 2017 11:34:21 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 84485C0586A2 for ; Fri, 1 Dec 2017 12:57:56 +0000 (UTC) Received: from secure.mitica (ovpn-117-171.ams2.redhat.com [10.36.117.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id 336C3600D4; Fri, 1 Dec 2017 12:57:55 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Fri, 1 Dec 2017 13:57:49 +0100 Message-Id: <20171201125750.1372-2-quintela@redhat.com> In-Reply-To: <20171201125750.1372-1-quintela@redhat.com> References: <20171201125750.1372-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 01 Dec 2017 12:57:56 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 1/2] migration: Create tcp_port parameter 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: lvivier@redhat.com, dgilbert@redhat.com, peterx@redhat.com 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" It will be used to store the uri tcp_port parameter. This is the only parameter than can change and we can need to be able to connect to it. Signed-off-by: Juan Quintela -- This used to be uri parameter, but it has so many troubles to reproduce that it don't just make sense. --- hmp.c | 7 +++++++ migration/migration.c | 10 ++++++++++ qapi/migration.json | 19 ++++++++++++++++--- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/hmp.c b/hmp.c index 1727c9c003..6387d6d517 100644 --- a/hmp.c +++ b/hmp.c @@ -345,6 +345,9 @@ void hmp_info_migrate_parameters(Monitor *mon, const QD= ict *qdict) monitor_printf(mon, "%s: %" PRIu64 "\n", MigrationParameter_str(MIGRATION_PARAMETER_XBZRLE_CACHE_SIZE), params->xbzrle_cache_size); + monitor_printf(mon, "%s: %d\n", + MigrationParameter_str(MIGRATION_PARAMETER_TCP_PORT), + params->tcp_port); } =20 qapi_free_MigrationParameters(params); @@ -1659,6 +1662,10 @@ void hmp_migrate_set_parameter(Monitor *mon, const Q= Dict *qdict) } p->xbzrle_cache_size =3D cache_size; break; + case MIGRATION_PARAMETER_TCP_PORT: + p->has_tcp_port =3D true; + visit_type_uint16(v, param, &p->tcp_port, &err); + break; default: assert(0); } diff --git a/migration/migration.c b/migration/migration.c index 19917a4b5b..abc02d4efd 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -517,6 +517,8 @@ MigrationParameters *qmp_query_migrate_parameters(Error= **errp) params->x_multifd_page_count =3D s->parameters.x_multifd_page_count; params->has_xbzrle_cache_size =3D true; params->xbzrle_cache_size =3D s->parameters.xbzrle_cache_size; + params->has_tcp_port =3D true; + params->tcp_port =3D s->parameters.tcp_port; =20 return params; } @@ -884,6 +886,9 @@ static void migrate_params_test_apply(MigrateSetParamet= ers *params, if (params->has_xbzrle_cache_size) { dest->xbzrle_cache_size =3D params->xbzrle_cache_size; } + if (params->has_tcp_port) { + dest->tcp_port =3D params->tcp_port; + } } =20 static void migrate_params_apply(MigrateSetParameters *params, Error **err= p) @@ -956,6 +961,9 @@ static void migrate_params_apply(MigrateSetParameters *= params, Error **errp) s->parameters.xbzrle_cache_size =3D params->xbzrle_cache_size; xbzrle_cache_resize(params->xbzrle_cache_size, errp); } + if (params->has_tcp_port) { + s->parameters.tcp_port =3D params->tcp_port; + } } =20 void qmp_migrate_set_parameters(MigrateSetParameters *params, Error **errp) @@ -2422,6 +2430,8 @@ static Property migration_properties[] =3D { DEFINE_PROP_SIZE("xbzrle-cache-size", MigrationState, parameters.xbzrle_cache_size, DEFAULT_MIGRATE_XBZRLE_CACHE_SIZE), + DEFINE_PROP_UINT16("x-tcp-port", MigrationState, + parameters.tcp_port, 0), =20 /* Migration capabilities */ DEFINE_PROP_MIG_CAP("x-xbzrle", MIGRATION_CAPABILITY_XBZRLE), diff --git a/qapi/migration.json b/qapi/migration.json index 4cd3d13158..e2a1d86216 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -488,6 +488,9 @@ # and a power of 2 # (Since 2.11) # +# @tcp-port: Only used for tcp, to know what is the real port +# (Since 2.12) +# # Since: 2.4 ## { 'enum': 'MigrationParameter', @@ -496,7 +499,7 @@ 'tls-creds', 'tls-hostname', 'max-bandwidth', 'downtime-limit', 'x-checkpoint-delay', 'block-incremental', 'x-multifd-channels', 'x-multifd-page-count', - 'xbzrle-cache-size' ] } + 'xbzrle-cache-size', 'tcp-port' ] } =20 ## # @MigrateSetParameters: @@ -564,6 +567,10 @@ # needs to be a multiple of the target page size # and a power of 2 # (Since 2.11) +# +# @tcp-port: Only used for tcp, to know what is the real port +# (Since 2.12) +# # Since: 2.4 ## # TODO either fuse back into MigrationParameters, or make @@ -582,7 +589,8 @@ '*block-incremental': 'bool', '*x-multifd-channels': 'int', '*x-multifd-page-count': 'int', - '*xbzrle-cache-size': 'size' } } + '*xbzrle-cache-size': 'size' , + '*tcp-port': 'uint16'} } =20 ## # @migrate-set-parameters: @@ -665,6 +673,10 @@ # needs to be a multiple of the target page size # and a power of 2 # (Since 2.11) +# +# @tcp-port: Only used for tcp, to know what is the real port +# (Since 2.12) +# # Since: 2.4 ## { 'struct': 'MigrationParameters', @@ -681,7 +693,8 @@ '*block-incremental': 'bool' , '*x-multifd-channels': 'uint8', '*x-multifd-page-count': 'uint32', - '*xbzrle-cache-size': 'size' } } + '*xbzrle-cache-size': 'size', + '*tcp-port': 'uint16'} } =20 ## # @query-migrate-parameters: --=20 2.14.3