@@ -581,10 +581,12 @@ 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->tls_creds = g_strdup(s->parameters.tls_creds);
- params->has_tls_hostname = !!s->parameters.tls_hostname;
- params->tls_hostname = g_strdup(s->parameters.tls_hostname);
+ params->has_tls_creds = true;
+ params->tls_creds = g_strdup(s->parameters.tls_creds ?
+ s->parameters.tls_creds : "");
+ params->has_tls_hostname = true;
+ params->tls_hostname = g_strdup(s->parameters.tls_hostname ?
+ s->parameters.tls_hostname : "");
params->has_max_bandwidth = true;
params->max_bandwidth = s->parameters.max_bandwidth;
params->has_downtime_limit = true;
@@ -1089,7 +1089,9 @@
# "compress-level": 1,
# "cpu-throttle-initial": 20,
# "max-bandwidth": 33554432,
-# "downtime-limit": 300
+# "downtime-limit": 300,
+# "tls-creds": "tls0",
+# "tls-hostname": ""
# }
# }
#
Currently the query-migrate-parameters command will omit reporting of the tls-creds & tls-hostname parameters if their value is NULL. This makes it impossible for an app to detect if these parameters are supported by QEMU, without trying to actually set them and catching the error. Since the code is treating "" and NULL as equivalent, we can simply always report these values and give them a value of "". This allows apps like libvirt to detect the fact that these parameters are supported by QEMU. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- migration/migration.c | 10 ++++++---- qapi-schema.json | 4 +++- 2 files changed, 9 insertions(+), 5 deletions(-)