From nobody Thu May 15 10:05:32 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1509055465113583.0353858482852; Thu, 26 Oct 2017 15:04:25 -0700 (PDT) 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 C4D1610476; Thu, 26 Oct 2017 22:04:23 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A36A5176A3; Thu, 26 Oct 2017 22:04:23 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6FBF36EF2C; Thu, 26 Oct 2017 22:04:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9QM49mK031952 for ; Thu, 26 Oct 2017 18:04:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id A97175D728; Thu, 26 Oct 2017 22:04:09 +0000 (UTC) Received: from mamuti.net (ovpn-204-16.brq.redhat.com [10.40.204.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0FD675D725 for ; Thu, 26 Oct 2017 22:04:09 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 933E6101494; Fri, 27 Oct 2017 00:04:02 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C4D1610476 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Fri, 27 Oct 2017 00:03:59 +0200 Message-Id: <275ea8ae6d77bfbead2717bd84d992ea1116088b.1509052291.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 10/12] qemu: Rename TLS related migration parameters X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@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.38]); Thu, 26 Oct 2017 22:04:24 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The parameters used "migrate" prefix which is pretty redundant and qemuMonitorMigrationParams structure is our internal representation of QEMU migration parameters and it is supposed to use names which match QEMU names. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 23 +++++++++++------------ src/qemu/qemu_monitor.c | 7 +++---- src/qemu/qemu_monitor.h | 4 ++-- src/qemu/qemu_monitor_json.c | 8 ++++---- tests/qemumonitorjsontest.c | 8 ++++---- 5 files changed, 24 insertions(+), 26 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index af744661f..e4e9e79cc 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -114,7 +114,7 @@ qemuMigrationCheckTLSCreds(virQEMUDriverPtr driver, goto cleanup; =20 /* NB: Could steal NULL pointer too! Let caller decide what to do. */ - VIR_STEAL_PTR(priv->migTLSAlias, migParams.migrateTLSAlias); + VIR_STEAL_PTR(priv->migTLSAlias, migParams.tlsCreds); =20 ret =3D 0; =20 @@ -225,7 +225,7 @@ qemuMigrationAddTLSObjects(virQEMUDriverPtr driver, *tlsAlias, &tlsProps) < 0) goto error; =20 - if (VIR_STRDUP(migParams->migrateTLSAlias, *tlsAlias) < 0) + if (VIR_STRDUP(migParams->tlsCreds, *tlsAlias) < 0) goto error; =20 return 0; @@ -2349,8 +2349,8 @@ qemuMigrationParamsClear(qemuMonitorMigrationParamsPt= r migParams) if (!migParams) return; =20 - VIR_FREE(migParams->migrateTLSAlias); - VIR_FREE(migParams->migrateTLSHostname); + VIR_FREE(migParams->tlsCreds); + VIR_FREE(migParams->tlsHostname); } =20 =20 @@ -2391,8 +2391,8 @@ qemuMigrationSetEmptyTLSParams(virQEMUDriverPtr drive= r, if (!priv->migTLSAlias) return 0; =20 - if (VIR_STRDUP(migParams->migrateTLSAlias, "") < 0 || - VIR_STRDUP(migParams->migrateTLSHostname, "") < 0) + if (VIR_STRDUP(migParams->tlsCreds, "") < 0 || + VIR_STRDUP(migParams->tlsHostname, "") < 0) return -1; =20 return 0; @@ -2508,8 +2508,8 @@ qemuMigrationResetTLS(virQEMUDriverPtr driver, qemuDomainDelTLSObjects(driver, vm, asyncJob, secAlias, tlsAlias); qemuDomainSecretInfoFree(&priv->migSecinfo); =20 - if (VIR_STRDUP(migParams.migrateTLSAlias, "") < 0 || - VIR_STRDUP(migParams.migrateTLSHostname, "") < 0 || + if (VIR_STRDUP(migParams.tlsCreds, "") < 0 || + VIR_STRDUP(migParams.tlsHostname, "") < 0 || qemuMigrationSetParams(driver, vm, asyncJob, &migParams) < 0) goto cleanup; =20 @@ -2774,7 +2774,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver, goto stopjob; =20 /* Force reset of 'tls-hostname', it's a source only parameter */ - if (VIR_STRDUP(migParams.migrateTLSHostname, "") < 0) + if (VIR_STRDUP(migParams.tlsHostname, "") < 0) goto stopjob; =20 } else { @@ -3737,12 +3737,11 @@ qemuMigrationRun(virQEMUDriverPtr driver, * connect directly to the destination. */ if (spec->destType =3D=3D MIGRATION_DEST_CONNECT_HOST || spec->destType =3D=3D MIGRATION_DEST_FD) { - if (VIR_STRDUP(migParams->migrateTLSHostname, - spec->dest.host.name) < 0) + if (VIR_STRDUP(migParams->tlsHostname, spec->dest.host.name) <= 0) goto error; } else { /* Be sure there's nothing from a previous migration */ - if (VIR_STRDUP(migParams->migrateTLSHostname, "") < 0) + if (VIR_STRDUP(migParams->tlsHostname, "") < 0) goto error; } } else { diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index c88726735..3e2c69a9a 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2606,15 +2606,14 @@ qemuMonitorSetMigrationParams(qemuMonitorPtr mon, { VIR_DEBUG("compressLevel=3D%d:%d compressThreads=3D%d:%d " "decompressThreads=3D%d:%d cpuThrottleInitial=3D%d:%d " - "cpuThrottleIncrement=3D%d:%d tlsAlias=3D%s " - "tlsHostname=3D%s downtimeLimit=3D%d:%llu", + "cpuThrottleIncrement=3D%d:%d tlsCreds=3D%s tlsHostname=3D%s= " + "downtimeLimit=3D%d:%llu", params->compressLevel_set, params->compressLevel, params->compressThreads_set, params->compressThreads, params->decompressThreads_set, params->decompressThreads, params->cpuThrottleInitial_set, params->cpuThrottleInitial, params->cpuThrottleIncrement_set, params->cpuThrottleIncreme= nt, - NULLSTR(params->migrateTLSAlias), - NULLSTR(params->migrateTLSHostname), + NULLSTR(params->tlsCreds), NULLSTR(params->tlsHostname), params->downtimeLimit_set, params->downtimeLimit); =20 QEMU_CHECK_MONITOR_JSON(mon); diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index bc8494fae..e123baaae 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -625,8 +625,8 @@ struct _qemuMonitorMigrationParams { =20 /* Value is either NULL, "", or some string. NULL indicates no support; * whereas, some string value indicates we can support setting/clearin= g */ - char *migrateTLSAlias; - char *migrateTLSHostname; + char *tlsCreds; + char *tlsHostname; =20 bool downtimeLimit_set; unsigned long long downtimeLimit; diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index a2f3e3317..9f238bc30 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2704,8 +2704,8 @@ qemuMonitorJSONGetMigrationParams(qemuMonitorPtr mon, PARSE_INT(decompressThreads, "decompress-threads"); PARSE_INT(cpuThrottleInitial, "cpu-throttle-initial"); PARSE_INT(cpuThrottleIncrement, "cpu-throttle-increment"); - PARSE_STR(migrateTLSAlias, "tls-creds"); - PARSE_STR(migrateTLSHostname, "tls-hostname"); + PARSE_STR(tlsCreds, "tls-creds"); + PARSE_STR(tlsHostname, "tls-hostname"); PARSE_ULONG(downtimeLimit, "downtime-limit"); =20 #undef PARSE_SET @@ -2762,8 +2762,8 @@ qemuMonitorJSONSetMigrationParams(qemuMonitorPtr mon, APPEND_INT(decompressThreads, "decompress-threads"); APPEND_INT(cpuThrottleInitial, "cpu-throttle-initial"); APPEND_INT(cpuThrottleIncrement, "cpu-throttle-increment"); - APPEND_STR(migrateTLSAlias, "tls-creds"); - APPEND_STR(migrateTLSHostname, "tls-hostname"); + APPEND_STR(tlsCreds, "tls-creds"); + APPEND_STR(tlsHostname, "tls-hostname"); APPEND_ULONG(downtimeLimit, "downtime-limit"); =20 #undef APPEND diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index cc55b0c43..aa5da8be9 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1853,8 +1853,8 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParams(= const void *data) CHECK_INT(decompressThreads, "decompress-threads", 2); CHECK_INT(cpuThrottleInitial, "cpu-throttle-initial", 20); CHECK_INT(cpuThrottleIncrement, "cpu-throttle-increment", 10); - CHECK_STR(migrateTLSAlias, "tls-creds", "tls0"); - CHECK_STR(migrateTLSHostname, "tls-hostname", ""); + CHECK_STR(tlsCreds, "tls-creds", "tls0"); + CHECK_STR(tlsHostname, "tls-hostname", ""); CHECK_ULONG(downtimeLimit, "downtime-limit", 500ULL); =20 #undef CHECK_NUM @@ -1865,8 +1865,8 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParams(= const void *data) ret =3D 0; =20 cleanup: - VIR_FREE(params.migrateTLSAlias); - VIR_FREE(params.migrateTLSHostname); + VIR_FREE(params.tlsCreds); + VIR_FREE(params.tlsHostname); qemuMonitorTestFree(test); return ret; } --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list