bool relabel = false;
int rv;
char *tlsAlias = NULL;
- char *secAlias = NULL;
virNWFilterReadLockFilterUpdates();
if (flags & VIR_MIGRATE_TLS) {
if (qemuMigrationParamsEnableTLS(driver, vm, true,
QEMU_ASYNC_JOB_MIGRATION_IN,
- &tlsAlias, &secAlias, NULL,
+ &tlsAlias, NULL,
migParams) < 0)
goto stopjob;
} else {
cleanup:
VIR_FREE(tlsAlias);
- VIR_FREE(secAlias);
qemuProcessIncomingDefFree(incoming);
VIR_FREE(xmlout);
VIR_FORCE_CLOSE(dataFD[0]);
qemuDomainObjPrivatePtr priv = vm->privateData;
qemuMigrationCookiePtr mig = NULL;
char *tlsAlias = NULL;
- char *secAlias = NULL;
qemuMigrationIOThreadPtr iothread = NULL;
int fd = -1;
unsigned long migrate_speed = resource ? resource : priv->migMaxBandwidth;
if (qemuMigrationParamsEnableTLS(driver, vm, false,
QEMU_ASYNC_JOB_MIGRATION_OUT,
- &tlsAlias, &secAlias, hostname,
+ &tlsAlias, hostname,
migParams) < 0)
goto error;
} else {
cleanup:
VIR_FREE(tlsAlias);
- VIR_FREE(secAlias);
VIR_FORCE_CLOSE(fd);
virDomainDefFree(persistDef);
qemuMigrationCookieFree(mig);
* @tlsListen: server or client
* @asyncJob: Migration job to join
* @tlsAlias: alias to be generated for TLS object
- * @secAlias: alias to be generated for a secinfo object
* @hostname: hostname of the migration destination
* @migParams: migration parameters to set
*
bool tlsListen,
int asyncJob,
char **tlsAlias,
- char **secAlias,
const char *hostname,
qemuMigrationParamsPtr migParams)
{
virJSONValuePtr tlsProps = NULL;
virJSONValuePtr secProps = NULL;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
+ const char *secAlias = NULL;
int ret = -1;
if (!cfg->migrateTLSx509certdir) {
}
/* If there's a secret, then grab/store it now using the connection */
- if (cfg->migrateTLSx509secretUUID &&
- !(priv->migSecinfo =
- qemuDomainSecretInfoTLSNew(priv, QEMU_MIGRATION_TLS_ALIAS_BASE,
- cfg->migrateTLSx509secretUUID)))
- goto error;
+ if (cfg->migrateTLSx509secretUUID) {
+ if (!(priv->migSecinfo =
+ qemuDomainSecretInfoTLSNew(priv, QEMU_MIGRATION_TLS_ALIAS_BASE,
+ cfg->migrateTLSx509secretUUID)))
+ goto error;
+ secAlias = priv->migSecinfo->s.aes.alias;
+ }
if (qemuDomainGetTLSObjects(priv->qemuCaps, priv->migSecinfo,
cfg->migrateTLSx509certdir, tlsListen,
cfg->migrateTLSx509verify,
QEMU_MIGRATION_TLS_ALIAS_BASE,
- &tlsProps, tlsAlias, &secProps, secAlias) < 0)
+ &tlsProps, tlsAlias, &secProps, NULL) < 0)
goto error;
/* Ensure the domain doesn't already have the TLS objects defined...
* This should prevent any issues just in case some cleanup wasn't
* properly completed (both src and dst use the same alias) or
* some other error path between now and perform . */
- qemuDomainDelTLSObjects(driver, vm, asyncJob, *secAlias, *tlsAlias);
+ qemuDomainDelTLSObjects(driver, vm, asyncJob, secAlias, *tlsAlias);
- if (qemuDomainAddTLSObjects(driver, vm, asyncJob, *secAlias, &secProps,
+ if (qemuDomainAddTLSObjects(driver, vm, asyncJob, secAlias, &secProps,
*tlsAlias, &tlsProps) < 0)
goto error;