qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, eblake@redhat.com, berrange@redhat.com,
	kwolf@redhat.com, mreitz@redhat.com, qemu-block@nongnu.org,
	quintela@redhat.com
Subject: Re: [Qemu-devel] [PATCH for-2.10 07/10] migration: Clean up around tls_creds, tls_hostname
Date: Tue, 18 Jul 2017 18:37:20 +0100	[thread overview]
Message-ID: <20170718173719.GE2106@work-vm> (raw)
In-Reply-To: <1500385286-21142-8-git-send-email-armbru@redhat.com>

* Markus Armbruster (armbru@redhat.com) wrote:
> 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 <armbru@redhat.com>

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> ---
>  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 2993586..2b2db3c 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_INCREMENT],
>              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 a0db40d..bae9808 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -438,9 +438,9 @@ MigrationParameters *qmp_query_migrate_parameters(Error **errp)
>      params->cpu_throttle_initial = s->parameters.cpu_throttle_initial;
>      params->has_cpu_throttle_increment = true;
>      params->cpu_throttle_increment = s->parameters.cpu_throttle_increment;
> -    params->has_tls_creds = !!s->parameters.tls_creds;
> +    params->has_tls_creds = true;
>      params->tls_creds = g_strdup(s->parameters.tls_creds);
> -    params->has_tls_hostname = !!s->parameters.tls_hostname;
> +    params->has_tls_hostname = true;
>      params->tls_hostname = g_strdup(s->parameters.tls_hostname);
>      params->has_max_bandwidth = true;
>      params->max_bandwidth = s->parameters.max_bandwidth;
> diff --git a/qapi-schema.json b/qapi-schema.json
> index 485767f..7b75cf1 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 credentials
>  #             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)
> -- 
> 2.7.5
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

  parent reply	other threads:[~2017-07-18 17:37 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-18 13:41 [Qemu-devel] [PATCH for-2.10 00/10] Correct two minor QMP interface design flaws Markus Armbruster
2017-07-18 13:41 ` [Qemu-devel] [PATCH for-2.10 01/10] qapi: Separate type QNull from QObject Markus Armbruster
2017-07-18 14:24   ` Eric Blake
2017-07-18 15:44   ` Daniel P. Berrange
2017-07-18 13:41 ` [Qemu-devel] [PATCH for-2.10 02/10] qapi: Use QNull for a more regular visit_type_null() Markus Armbruster
2017-07-18 14:36   ` Eric Blake
2017-07-18 15:05     ` Markus Armbruster
2017-07-18 15:46   ` Daniel P. Berrange
2017-07-18 13:41 ` [Qemu-devel] [PATCH for-2.10 03/10] qapi: Introduce a first class 'null' type Markus Armbruster
2017-07-18 14:53   ` Eric Blake
2017-07-18 14:54     ` Eric Blake
2017-07-18 15:21       ` Markus Armbruster
2017-07-18 19:43         ` Markus Armbruster
2017-07-18 19:47           ` Eric Blake
2017-07-18 20:02             ` Markus Armbruster
2017-07-18 20:08           ` Eric Blake
2017-07-18 20:27             ` Markus Armbruster
2017-07-18 15:20     ` Markus Armbruster
2017-07-18 15:47   ` Daniel P. Berrange
2017-07-18 13:41 ` [Qemu-devel] [PATCH for-2.10 04/10] tests/test-qobject-input-visitor: Drop redundant test Markus Armbruster
2017-07-18 15:13   ` Eric Blake
2017-07-18 15:47   ` Daniel P. Berrange
2017-07-18 13:41 ` [Qemu-devel] [PATCH for-2.10 05/10] block: Use JSON null instead of "" to disable backing file Markus Armbruster
2017-07-18 15:53   ` Daniel P. Berrange
2017-07-18 17:27   ` Eric Blake
2017-07-18 13:41 ` [Qemu-devel] [PATCH for-2.10 06/10] hmp: Clean up and simplify hmp_migrate_set_parameter() Markus Armbruster
2017-07-18 15:54   ` Daniel P. Berrange
2017-07-18 17:09   ` Dr. David Alan Gilbert
2017-07-18 17:34   ` Eric Blake
2017-07-18 18:28     ` Markus Armbruster
2017-07-18 13:41 ` [Qemu-devel] [PATCH for-2.10 07/10] migration: Clean up around tls_creds, tls_hostname Markus Armbruster
2017-07-18 15:57   ` Daniel P. Berrange
2017-07-18 17:36   ` Eric Blake
2017-07-18 17:37   ` Dr. David Alan Gilbert [this message]
2017-07-18 13:41 ` [Qemu-devel] [PATCH for-2.10 08/10] migration: Add TODO comments on duplication of QAPI_CLONE() Markus Armbruster
2017-07-18 15:57   ` Daniel P. Berrange
2017-07-18 17:36   ` Eric Blake
2017-07-18 13:41 ` [Qemu-devel] [PATCH for-2.10 09/10] migration: Unshare MigrationParameters struct for now Markus Armbruster
2017-07-18 16:01   ` Daniel P. Berrange
2017-07-18 17:42   ` Eric Blake
2017-07-18 13:41 ` [Qemu-devel] [PATCH for-2.10 10/10] migration: Use JSON null instead of "" to reset parameter to default Markus Armbruster
2017-07-18 16:03   ` Daniel P. Berrange
2017-07-18 17:46   ` Eric Blake
2017-07-18 18:37     ` Markus Armbruster
2017-07-18 18:39     ` Markus Armbruster
2017-07-18 19:09       ` Eric Blake
2017-07-18 19:32         ` Markus Armbruster
2017-07-18 19:55           ` Eric Blake
2017-07-18 17:52   ` Dr. David Alan Gilbert
2017-07-18 19:24     ` Markus Armbruster
2017-07-19  8:32       ` Daniel P. Berrange
2017-07-18 14:02 ` [Qemu-devel] [PATCH for-2.10 00/10] Correct two minor QMP interface design flaws no-reply
2017-07-18 16:08 ` Daniel P. Berrange
2017-07-19  6:12   ` Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170718173719.GE2106@work-vm \
    --to=dgilbert@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).