From nobody Sat Apr 20 12:42:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1585101056; cv=none; d=zohomail.com; s=zohoarc; b=PUaw4H3zhR8JDpvCkILZA32qgxzhPjBZzHweo9EYIv2YzEjDGzIbXlrTlAVxE6lAJBUlutVSbOftPjEAI4dFfR/RNgl93puMom9iGWEKnqAYRBqMLb4IIgxWiREVhcD8OeDF0KsTJUnzDrfOQKdADAnk2xlxOYiaqVTesa9JERs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585101056; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=GoflM/WvkCrAP11MO43OBfgT98Nj1ZzkQYNmM8/Pn24=; b=eFNdFVZ2SJ9KyPsVEqISNx6HmZyEFXfKsAnRyIrobru815DsH1u1Eg6H1ZqJEWIBl0ud3ML/wD9Aez3qAYCLEL5OB470M2o1qs37ZwX/IuZT4W6ekTus1kd3FAqW4TZUvcxlVw3z8ussGpOHqTopb1e7gJrzGBjtIyfR0LbP83o= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1585101056418755.144948144782; Tue, 24 Mar 2020 18:50:56 -0700 (PDT) Received: from localhost ([::1]:57402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGvC2-0005bl-H9 for importer@patchew.org; Tue, 24 Mar 2020 21:50:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36019) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGvBM-00058R-AN for qemu-devel@nongnu.org; Tue, 24 Mar 2020 21:50:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGvBK-0004Up-W6 for qemu-devel@nongnu.org; Tue, 24 Mar 2020 21:50:11 -0400 Received: from cmccmta1.chinamobile.com ([221.176.66.79]:3972) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jGvBK-0004KD-Da for qemu-devel@nongnu.org; Tue, 24 Mar 2020 21:50:10 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.17]) by rmmx-syy-dmz-app01-12001 (RichMail) with SMTP id 2ee15e7ab8b8c2a-9996e; Wed, 25 Mar 2020 09:49:44 +0800 (CST) Received: from localhost.localdomain (unknown[112.25.154.146]) by rmsmtp-syy-appsvr09-12009 (RichMail) with SMTP id 2ee95e7ab8b0685-52244; Wed, 25 Mar 2020 09:49:44 +0800 (CST) X-RM-TRANSID: 2ee15e7ab8b8c2a-9996e X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee95e7ab8b0685-52244 From: Mao Zhongyi To: qemu-devel@nongnu.org Subject: [PATCH v3] migration: use "" instead of (null) for tls-authz Date: Wed, 25 Mar 2020 09:49:30 +0800 Message-Id: <119f539a9f4d198bc3bcced46b8280520d60bc51.1585100802.git.maozhongyi@cmss.chinamobile.com> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 221.176.66.79 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: quintela@redhat.com, dgilbert@redhat.com, Mao Zhongyi , armbru@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" run: (qemu) info migrate_parameters announce-initial: 50 ms ... announce-max: 550 ms multifd-compression: none xbzrle-cache-size: 4194304 max-postcopy-bandwidth: 0 tls-authz: '(null)' Migration parameter 'tls-authz' is used to provide the QOM ID of a QAuthZ subclass instance that provides the access control check, default is NULL. But the empty string is not a valid object ID, so use "" instead of the default. Although it will fail when lookup an object with ID "", it is harmless, just consistent with tls_creds. As a bonus, this patch also fixed the bad indentation on the last line and removed 'has_tls_authz' redundant check in 'hmp_info_migrate_parameters'. Signed-off-by: Mao Zhongyi Reviewed-by: Dr. David Alan Gilbert --- migration/migration.c | 3 ++- monitor/hmp-cmds.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 4b26110d57..c4c9aee15e 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -790,7 +790,8 @@ MigrationParameters *qmp_query_migrate_parameters(Error= **errp) params->has_tls_hostname =3D true; params->tls_hostname =3D g_strdup(s->parameters.tls_hostname); params->has_tls_authz =3D true; - params->tls_authz =3D g_strdup(s->parameters.tls_authz); + params->tls_authz =3D g_strdup(s->parameters.tls_authz ? + s->parameters.tls_authz : ""); params->has_max_bandwidth =3D true; params->max_bandwidth =3D s->parameters.max_bandwidth; params->has_downtime_limit =3D true; diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index a71de0e60b..dc48e6986c 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -459,9 +459,9 @@ void hmp_info_migrate_parameters(Monitor *mon, const QD= ict *qdict) monitor_printf(mon, "%s: %" PRIu64 "\n", MigrationParameter_str(MIGRATION_PARAMETER_MAX_POSTCOPY_BANDWI= DTH), params->max_postcopy_bandwidth); - monitor_printf(mon, " %s: '%s'\n", + monitor_printf(mon, "%s: '%s'\n", MigrationParameter_str(MIGRATION_PARAMETER_TLS_AUTHZ), - params->has_tls_authz ? params->tls_authz : ""); + params->tls_authz); } =20 qapi_free_MigrationParameters(params); --=20 2.17.1