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; goto cleanup;
/* NB: Could steal NULL pointer too! Let caller decide what to do. */ /* 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; ret = 0;
@ -225,7 +225,7 @@ qemuMigrationAddTLSObjects(virQEMUDriverPtr driver,
*tlsAlias, &tlsProps) < 0) *tlsAlias, &tlsProps) < 0)
goto error; goto error;
if (VIR_STRDUP(migParams->migrateTLSAlias, *tlsAlias) < 0) if (VIR_STRDUP(migParams->tlsCreds, *tlsAlias) < 0)
goto error; goto error;
return 0; return 0;
@ -2349,8 +2349,8 @@ qemuMigrationParamsClear(qemuMonitorMigrationParamsPtr migParams)
if (!migParams) if (!migParams)
return; return;
VIR_FREE(migParams->migrateTLSAlias); VIR_FREE(migParams->tlsCreds);
VIR_FREE(migParams->migrateTLSHostname); VIR_FREE(migParams->tlsHostname);
} }
@ -2391,8 +2391,8 @@ qemuMigrationSetEmptyTLSParams(virQEMUDriverPtr driver,
if (!priv->migTLSAlias) if (!priv->migTLSAlias)
return 0; return 0;
if (VIR_STRDUP(migParams->migrateTLSAlias, "") < 0 || if (VIR_STRDUP(migParams->tlsCreds, "") < 0 ||
VIR_STRDUP(migParams->migrateTLSHostname, "") < 0) VIR_STRDUP(migParams->tlsHostname, "") < 0)
return -1; return -1;
return 0; return 0;
@ -2508,8 +2508,8 @@ qemuMigrationResetTLS(virQEMUDriverPtr driver,
qemuDomainDelTLSObjects(driver, vm, asyncJob, secAlias, tlsAlias); qemuDomainDelTLSObjects(driver, vm, asyncJob, secAlias, tlsAlias);
qemuDomainSecretInfoFree(&priv->migSecinfo); qemuDomainSecretInfoFree(&priv->migSecinfo);
if (VIR_STRDUP(migParams.migrateTLSAlias, "") < 0 || if (VIR_STRDUP(migParams.tlsCreds, "") < 0 ||
VIR_STRDUP(migParams.migrateTLSHostname, "") < 0 || VIR_STRDUP(migParams.tlsHostname, "") < 0 ||
qemuMigrationSetParams(driver, vm, asyncJob, &migParams) < 0) qemuMigrationSetParams(driver, vm, asyncJob, &migParams) < 0)
goto cleanup; goto cleanup;
@ -2774,7 +2774,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
goto stopjob; goto stopjob;
/* Force reset of 'tls-hostname', it's a source only parameter */ /* 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; goto stopjob;
} else { } else {
@ -3737,12 +3737,11 @@ qemuMigrationRun(virQEMUDriverPtr driver,
* connect directly to the destination. */ * connect directly to the destination. */
if (spec->destType == MIGRATION_DEST_CONNECT_HOST || if (spec->destType == MIGRATION_DEST_CONNECT_HOST ||
spec->destType == MIGRATION_DEST_FD) { spec->destType == MIGRATION_DEST_FD) {
if (VIR_STRDUP(migParams->migrateTLSHostname, if (VIR_STRDUP(migParams->tlsHostname, spec->dest.host.name) < 0)
spec->dest.host.name) < 0)
goto error; goto error;
} else { } else {
/* Be sure there's nothing from a previous migration */ /* Be sure there's nothing from a previous migration */
if (VIR_STRDUP(migParams->migrateTLSHostname, "") < 0) if (VIR_STRDUP(migParams->tlsHostname, "") < 0)
goto error; goto error;
} }
} else { } else {

View File

@ -2606,15 +2606,14 @@ qemuMonitorSetMigrationParams(qemuMonitorPtr mon,
{ {
VIR_DEBUG("compressLevel=%d:%d compressThreads=%d:%d " VIR_DEBUG("compressLevel=%d:%d compressThreads=%d:%d "
"decompressThreads=%d:%d cpuThrottleInitial=%d:%d " "decompressThreads=%d:%d cpuThrottleInitial=%d:%d "
"cpuThrottleIncrement=%d:%d tlsAlias=%s " "cpuThrottleIncrement=%d:%d tlsCreds=%s tlsHostname=%s "
"tlsHostname=%s downtimeLimit=%d:%llu", "downtimeLimit=%d:%llu",
params->compressLevel_set, params->compressLevel, params->compressLevel_set, params->compressLevel,
params->compressThreads_set, params->compressThreads, params->compressThreads_set, params->compressThreads,
params->decompressThreads_set, params->decompressThreads, params->decompressThreads_set, params->decompressThreads,
params->cpuThrottleInitial_set, params->cpuThrottleInitial, params->cpuThrottleInitial_set, params->cpuThrottleInitial,
params->cpuThrottleIncrement_set, params->cpuThrottleIncrement, params->cpuThrottleIncrement_set, params->cpuThrottleIncrement,
NULLSTR(params->migrateTLSAlias), NULLSTR(params->tlsCreds), NULLSTR(params->tlsHostname),
NULLSTR(params->migrateTLSHostname),
params->downtimeLimit_set, params->downtimeLimit); params->downtimeLimit_set, params->downtimeLimit);
QEMU_CHECK_MONITOR_JSON(mon); QEMU_CHECK_MONITOR_JSON(mon);

View File

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

View File

@ -2704,8 +2704,8 @@ qemuMonitorJSONGetMigrationParams(qemuMonitorPtr mon,
PARSE_INT(decompressThreads, "decompress-threads"); PARSE_INT(decompressThreads, "decompress-threads");
PARSE_INT(cpuThrottleInitial, "cpu-throttle-initial"); PARSE_INT(cpuThrottleInitial, "cpu-throttle-initial");
PARSE_INT(cpuThrottleIncrement, "cpu-throttle-increment"); PARSE_INT(cpuThrottleIncrement, "cpu-throttle-increment");
PARSE_STR(migrateTLSAlias, "tls-creds"); PARSE_STR(tlsCreds, "tls-creds");
PARSE_STR(migrateTLSHostname, "tls-hostname"); PARSE_STR(tlsHostname, "tls-hostname");
PARSE_ULONG(downtimeLimit, "downtime-limit"); PARSE_ULONG(downtimeLimit, "downtime-limit");
#undef PARSE_SET #undef PARSE_SET
@ -2762,8 +2762,8 @@ qemuMonitorJSONSetMigrationParams(qemuMonitorPtr mon,
APPEND_INT(decompressThreads, "decompress-threads"); APPEND_INT(decompressThreads, "decompress-threads");
APPEND_INT(cpuThrottleInitial, "cpu-throttle-initial"); APPEND_INT(cpuThrottleInitial, "cpu-throttle-initial");
APPEND_INT(cpuThrottleIncrement, "cpu-throttle-increment"); APPEND_INT(cpuThrottleIncrement, "cpu-throttle-increment");
APPEND_STR(migrateTLSAlias, "tls-creds"); APPEND_STR(tlsCreds, "tls-creds");
APPEND_STR(migrateTLSHostname, "tls-hostname"); APPEND_STR(tlsHostname, "tls-hostname");
APPEND_ULONG(downtimeLimit, "downtime-limit"); APPEND_ULONG(downtimeLimit, "downtime-limit");
#undef APPEND #undef APPEND

View File

@ -1853,8 +1853,8 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParams(const void *data)
CHECK_INT(decompressThreads, "decompress-threads", 2); CHECK_INT(decompressThreads, "decompress-threads", 2);
CHECK_INT(cpuThrottleInitial, "cpu-throttle-initial", 20); CHECK_INT(cpuThrottleInitial, "cpu-throttle-initial", 20);
CHECK_INT(cpuThrottleIncrement, "cpu-throttle-increment", 10); CHECK_INT(cpuThrottleIncrement, "cpu-throttle-increment", 10);
CHECK_STR(migrateTLSAlias, "tls-creds", "tls0"); CHECK_STR(tlsCreds, "tls-creds", "tls0");
CHECK_STR(migrateTLSHostname, "tls-hostname", ""); CHECK_STR(tlsHostname, "tls-hostname", "");
CHECK_ULONG(downtimeLimit, "downtime-limit", 500ULL); CHECK_ULONG(downtimeLimit, "downtime-limit", 500ULL);
#undef CHECK_NUM #undef CHECK_NUM
@ -1865,8 +1865,8 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationParams(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
VIR_FREE(params.migrateTLSAlias); VIR_FREE(params.tlsCreds);
VIR_FREE(params.migrateTLSHostname); VIR_FREE(params.tlsHostname);
qemuMonitorTestFree(test); qemuMonitorTestFree(test);
return ret; return ret;
} }