From nobody Tue Feb 10 21:59:50 2026 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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=temperror (zoho.com: Error in retrieving data from DNS) 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 1511354682636552.809968053104; Wed, 22 Nov 2017 04:44:42 -0800 (PST) Received: from localhost ([::1]:39151 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHUO9-0005nV-5w for importer@patchew.org; Wed, 22 Nov 2017 07:44:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHUMK-0004gU-Aa for qemu-devel@nongnu.org; Wed, 22 Nov 2017 07:42:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHUMJ-0007A1-76 for qemu-devel@nongnu.org; Wed, 22 Nov 2017 07:42:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33168) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eHUMI-00079f-Uz for qemu-devel@nongnu.org; Wed, 22 Nov 2017 07:42:31 -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 179783C92 for ; Wed, 22 Nov 2017 12:42:30 +0000 (UTC) Received: from secure.mitica (ovpn-116-72.ams2.redhat.com [10.36.116.72]) by smtp.corp.redhat.com (Postfix) with ESMTP id 85DDB6A849; Wed, 22 Nov 2017 12:42:28 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 22 Nov 2017 13:42:16 +0100 Message-Id: <20171122124219.12954-4-quintela@redhat.com> In-Reply-To: <20171122124219.12954-1-quintela@redhat.com> References: <20171122124219.12954-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.29]); Wed, 22 Nov 2017 12:42:30 +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 v2 3/6] migration: Create uri 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_6 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 migration parameter. Right now it is just the parameter code. Signed-off-by: Juan Quintela --- hmp.c | 7 +++++++ migration/migration.c | 13 +++++++++++++ qapi/migration.json | 18 +++++++++++++++--- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/hmp.c b/hmp.c index 35a7041824..c9241f6947 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: %" PRId64 "\n", MigrationParameter_str(MIGRATION_PARAMETER_XBZRLE_CACHE_SIZE), params->xbzrle_cache_size); + monitor_printf(mon, "%s: %s\n", + MigrationParameter_str(MIGRATION_PARAMETER_URI), + params->uri); } =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_URI: + p->has_uri =3D true; + visit_type_str(v, param, &p->uri, &err); + break; default: assert(0); } diff --git a/migration/migration.c b/migration/migration.c index 706d2407ec..3e48d37880 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_uri =3D true; + params->uri =3D g_strdup(s->parameters.uri); =20 return params; } @@ -893,6 +895,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_uri) { + dest->uri =3D g_strdup(params->uri); + } } =20 static void migrate_params_apply(MigrateSetParameters *params, Error **err= p) @@ -965,6 +970,10 @@ 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_uri) { + g_free(s->parameters.uri); + s->parameters.uri =3D g_strdup(params->uri); + } } =20 void qmp_migrate_set_parameters(MigrateSetParameters *params, Error **errp) @@ -2431,6 +2440,8 @@ static Property migration_properties[] =3D { DEFINE_PROP_SIZE("xbzrle-cache-size", MigrationState, parameters.xbzrle_cache_size, DEFAULT_MIGRATE_XBZRLE_CACHE_SIZE), + DEFINE_PROP_STRING("x-uri", MigrationState, + parameters.uri), =20 /* Migration capabilities */ DEFINE_PROP_MIG_CAP("x-xbzrle", MIGRATION_CAPABILITY_XBZRLE), @@ -2465,6 +2476,7 @@ static void migration_instance_finalize(Object *obj) qemu_mutex_destroy(&ms->error_mutex); g_free(params->tls_hostname); g_free(params->tls_creds); + g_free(params->uri); qemu_sem_destroy(&ms->pause_sem); } =20 @@ -2480,6 +2492,7 @@ static void migration_instance_init(Object *obj) =20 params->tls_hostname =3D g_strdup(""); params->tls_creds =3D g_strdup(""); + params->uri =3D g_strdup(""); =20 /* Set has_* up only for parameter checks */ params->has_compress_level =3D true; diff --git a/qapi/migration.json b/qapi/migration.json index bbc4671ded..ebde890604 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -488,6 +488,9 @@ # and a power of 2 # (Since 2.11) # +# @uri: defines the method we are susing to migrate +# (Since 2.11) +# # 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', 'uri' ] } =20 ## # @MigrateSetParameters: @@ -564,6 +567,10 @@ # needs to be a multiple of the target page size # and a power of 2 # (Since 2.11) +# +# @uri: defines the method we are susing to migrate +# (Since 2.11) +# # 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' , + '*uri': 'str'} } =20 ## # @migrate-set-parameters: @@ -665,6 +673,9 @@ # needs to be a multiple of the target page size # and a power of 2 # (Since 2.11) +# +# @uri: defines the method we are susing to migrate +# (Since 2.11) # Since: 2.4 ## { 'struct': 'MigrationParameters', @@ -681,7 +692,8 @@ '*block-incremental': 'bool' , '*x-multifd-channels': 'int', '*x-multifd-page-count': 'int', - '*xbzrle-cache-size': 'size' } } + '*xbzrle-cache-size': 'size' , + '*uri': 'str'} } =20 ## # @query-migrate-parameters: --=20 2.13.6