From nobody Sun Feb 8 14:35:28 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.zoho.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 1488458334745585.8356554786234; Thu, 2 Mar 2017 04:38:54 -0800 (PST) Received: from localhost ([::1]:51891 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjQ0T-0007zW-Aw for importer@patchew.org; Thu, 02 Mar 2017 07:38:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55653) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjPzd-0007xm-UE for qemu-devel@nongnu.org; Thu, 02 Mar 2017 07:38:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cjPzc-0005ea-Ng for qemu-devel@nongnu.org; Thu, 02 Mar 2017 07:38:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39980) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cjPzc-0005cU-Hn for qemu-devel@nongnu.org; Thu, 02 Mar 2017 07:38:00 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AF115326BB for ; Thu, 2 Mar 2017 12:38:00 +0000 (UTC) Received: from t460.redhat.com (ovpn-117-78.ams2.redhat.com [10.36.117.78]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v22CbnJw009746; Thu, 2 Mar 2017 07:37:57 -0500 From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Thu, 2 Mar 2017 12:37:46 +0000 Message-Id: <20170302123746.9694-3-berrange@redhat.com> In-Reply-To: <20170302123746.9694-1-berrange@redhat.com> References: <20170302123746.9694-1-berrange@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 02 Mar 2017 12:38:00 +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 2/2] migration: always report tls-creds & tls-hostname migrate parameters 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: Juan Quintela , Markus Armbruster , "Dr. David Alan Gilbert" , John Ferlan , Jiri Denemark 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" 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 --- migration/migration.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index a8cb56e..760f104 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -581,10 +581,12 @@ MigrationParameters *qmp_query_migrate_parameters(Err= or **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->tls_creds =3D g_strdup(s->parameters.tls_creds); - params->has_tls_hostname =3D !!s->parameters.tls_hostname; - params->tls_hostname =3D g_strdup(s->parameters.tls_hostname); + params->has_tls_creds =3D true; + params->tls_creds =3D g_strdup(s->parameters.tls_creds ? + s->parameters.tls_creds : ""); + params->has_tls_hostname =3D true; + params->tls_hostname =3D g_strdup(s->parameters.tls_hostname ? + s->parameters.tls_hostname : ""); params->has_max_bandwidth =3D true; params->max_bandwidth =3D s->parameters.max_bandwidth; params->has_downtime_limit =3D true; --=20 2.9.3