From nobody Mon Feb 9 09:33:41 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 1500897681415536.717763254904; Mon, 24 Jul 2017 05:01:21 -0700 (PDT) Received: from localhost ([::1]:54247 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZc32-0004be-Ng for importer@patchew.org; Mon, 24 Jul 2017 08:01:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZbyz-00015a-DL for qemu-devel@nongnu.org; Mon, 24 Jul 2017 07:57:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dZbyy-0006tN-9D for qemu-devel@nongnu.org; Mon, 24 Jul 2017 07:57:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34180) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dZbyy-0006sF-0L for qemu-devel@nongnu.org; Mon, 24 Jul 2017 07:57:04 -0400 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 E691AC0B772A for ; Mon, 24 Jul 2017 11:57:02 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-94.ams2.redhat.com [10.36.116.94]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 72DE184788 for ; Mon, 24 Jul 2017 11:57:02 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5420311386C9; Mon, 24 Jul 2017 13:56:59 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E691AC0B772A Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=armbru@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E691AC0B772A From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 24 Jul 2017 13:56:56 +0200 Message-Id: <1500897419-15539-8-git-send-email-armbru@redhat.com> In-Reply-To: <1500897419-15539-1-git-send-email-armbru@redhat.com> References: <1500897419-15539-1-git-send-email-armbru@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.31]); Mon, 24 Jul 2017 11:57:03 +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] [PULL v2 07/10] migration: Clean up around tls_creds, tls_hostname 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: , 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" Optional MigrationParameters members tls_creds and tls_hostname can't actually be absent outside qmp_migrate_set_parameters() since commit 4af245d (v2.9.0). Note that commit 4af245d reverted the part of commit de63ab6 (v2.8.0) that made tls_creds and tls_hostname absent instead of "" in the value of query-migrate-parameters, even though commit de63ab6 called that a mistake. What a mess. Drop the redundant tests for presence, and update documentation. Signed-off-by: Markus Armbruster Reviewed-by: Daniel P. Berrange Reviewed-by: Eric Blake Reviewed-by: Dr. David Alan Gilbert --- hmp.c | 6 ++++-- migration/migration.c | 4 ++-- qapi-schema.json | 11 +++++------ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/hmp.c b/hmp.c index dae4604..d7b4727 100644 --- a/hmp.c +++ b/hmp.c @@ -313,12 +313,14 @@ void hmp_info_migrate_parameters(Monitor *mon, const = QDict *qdict) monitor_printf(mon, "%s: %" PRId64 "\n", MigrationParameter_lookup[MIGRATION_PARAMETER_CPU_THROTTLE_INC= REMENT], params->cpu_throttle_increment); + assert(params->has_tls_creds); monitor_printf(mon, "%s: '%s'\n", MigrationParameter_lookup[MIGRATION_PARAMETER_TLS_CREDS], - params->has_tls_creds ? params->tls_creds : ""); + params->tls_creds); + assert(params->has_tls_hostname); monitor_printf(mon, "%s: '%s'\n", MigrationParameter_lookup[MIGRATION_PARAMETER_TLS_HOSTNAME], - params->has_tls_hostname ? params->tls_hostname : ""); + params->tls_hostname); assert(params->has_max_bandwidth); monitor_printf(mon, "%s: %" PRId64 " bytes/second\n", MigrationParameter_lookup[MIGRATION_PARAMETER_MAX_BANDWIDTH], diff --git a/migration/migration.c b/migration/migration.c index 7615391..88b9277 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -444,9 +444,9 @@ MigrationParameters *qmp_query_migrate_parameters(Error= **errp) params->cpu_throttle_initial =3D s->parameters.cpu_throttle_initial; params->has_cpu_throttle_increment =3D true; params->cpu_throttle_increment =3D s->parameters.cpu_throttle_incremen= t; - params->has_tls_creds =3D !!s->parameters.tls_creds; + params->has_tls_creds =3D true; params->tls_creds =3D g_strdup(s->parameters.tls_creds); - params->has_tls_hostname =3D !!s->parameters.tls_hostname; + params->has_tls_hostname =3D true; params->tls_hostname =3D g_strdup(s->parameters.tls_hostname); params->has_max_bandwidth =3D true; params->max_bandwidth =3D s->parameters.max_bandwidth; diff --git a/qapi-schema.json b/qapi-schema.json index 58d3a02..a9c2f05 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -1054,9 +1054,7 @@ # @MigrationParameters: # # Optional members can be omitted on input ('migrate-set-parameters') -# but most members will always be present on output -# ('query-migrate-parameters'), with the exception of tls-creds and -# tls-hostname. +# but members will always be present on output. # # @compress-level: compression level # @@ -1077,10 +1075,10 @@ # channel. On the outgoing side of the migration, the credenti= als # must be for a 'client' endpoint, while for the incoming side= the # credentials must be for a 'server' endpoint. Setting this -# will enable TLS for all migrations. The default is unset, -# resulting in unsecured migration at the QEMU level. (Since 2= .7) +# to a non-empty string enables TLS for all migrations. # An empty string means that QEMU will use plain text mode for -# migration, rather than TLS (Since 2.9) +# migration, rather than TLS (Since 2.7) +# Note: 2.8 reports this by omitting tls-creds instead. # # @tls-hostname: hostname of the target host for the migration. This # is required when using x509 based TLS credentials and the @@ -1090,6 +1088,7 @@ # certificate identity can be validated. (Since 2.7) # An empty string means that QEMU will use the hostname # associated with the migration URI, if any. (Since 2.9) +# Note: 2.8 reports this by omitting tls-hostname instead. # # @max-bandwidth: to set maximum speed for migration. maximum speed in # bytes per second. (Since 2.8) --=20 2.7.5