qemu: Rename TLS related migration parameters

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 <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
Jiri Denemark 2017-10-26 20:11:47 +02:00
parent 2384b6f019
commit af1d2fe270
5 changed files with 24 additions and 26 deletions

View File

@ -114,7 +114,7 @@ qemuMigrationCheckTLSCreds(virQEMUDriverPtr driver,
goto cleanup;
/* 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);
ret = 0;
@ -225,7 +225,7 @@ qemuMigrationAddTLSObjects(virQEMUDriverPtr driver,
*tlsAlias, &tlsProps) < 0)
goto error;
if (VIR_STRDUP(migParams->migrateTLSAlias, *tlsAlias) < 0)
if (VIR_STRDUP(migParams->tlsCreds, *tlsAlias) < 0)
goto error;
return 0;
@ -2349,8 +2349,8 @@ qemuMigrationParamsClear(qemuMonitorMigrationParamsPtr migParams)
if (!migParams)
return;
VIR_FREE(migParams->migrateTLSAlias);
VIR_FREE(migParams->migrateTLSHostname);
VIR_FREE(migParams->tlsCreds);
VIR_FREE(migParams->tlsHostname);
}
@ -2391,8 +2391,8 @@ qemuMigrationSetEmptyTLSParams(virQEMUDriverPtr driver,
if (!priv->migTLSAlias)
return 0;
if (VIR_STRDUP(migParams->migrateTLSAlias, "") < 0 ||
VIR_STRDUP(migParams->migrateTLSHostname, "") < 0)
if (VIR_STRDUP(migParams->tlsCreds, "") < 0 ||
VIR_STRDUP(migParams->tlsHostname, "") < 0)
return -1;
return 0;
@ -2508,8 +2508,8 @@ qemuMigrationResetTLS(virQEMUDriverPtr driver,
qemuDomainDelTLSObjects(driver, vm, asyncJob, secAlias, tlsAlias);
qemuDomainSecretInfoFree(&priv->migSecinfo);
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;
@ -2774,7 +2774,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
goto stopjob;
/* 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;
} else {
@ -3737,12 +3737,11 @@ qemuMigrationRun(virQEMUDriverPtr driver,
* connect directly to the destination. */
if (spec->destType == MIGRATION_DEST_CONNECT_HOST ||
spec->destType == 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 {

View File

@ -2606,15 +2606,14 @@ qemuMonitorSetMigrationParams(qemuMonitorPtr mon,
{
VIR_DEBUG("compressLevel=%d:%d compressThreads=%d:%d "
"decompressThreads=%d:%d cpuThrottleInitial=%d:%d "
"cpuThrottleIncrement=%d:%d tlsAlias=%s "
"tlsHostname=%s downtimeLimit=%d:%llu",
"cpuThrottleIncrement=%d:%d tlsCreds=%s tlsHostname=%s "
"downtimeLimit=%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->cpuThrottleIncrement,
NULLSTR(params->migrateTLSAlias),
NULLSTR(params->migrateTLSHostname),
NULLSTR(params->tlsCreds), NULLSTR(params->tlsHostname),
params->downtimeLimit_set, params->downtimeLimit);
QEMU_CHECK_MONITOR_JSON(mon);

View File

@ -625,8 +625,8 @@ struct _qemuMonitorMigrationParams {
/* Value is either NULL, "", or some string. NULL indicates no support;
* whereas, some string value indicates we can support setting/clearing */
char *migrateTLSAlias;
char *migrateTLSHostname;
char *tlsCreds;
char *tlsHostname;
bool downtimeLimit_set;
unsigned long long downtimeLimit;

View File

@ -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");
#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");
#undef APPEND

View File

@ -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);
#undef CHECK_NUM
@ -1865,8 +1865,8 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParams(const void *data)
ret = 0;
cleanup:
VIR_FREE(params.migrateTLSAlias);
VIR_FREE(params.migrateTLSHostname);
VIR_FREE(params.tlsCreds);
VIR_FREE(params.tlsHostname);
qemuMonitorTestFree(test);
return ret;
}