Callers should generate the alias separately. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/qemu/qemu_hotplug.c | 14 +++++--------- src/qemu/qemu_hotplug.h | 2 -- src/qemu/qemu_migration_params.c | 6 ++++-- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 94705abb8a..4f58cfbd9a 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -166,7 +166,7 @@ qemuDomainAddDiskSrcTLSObject(virQEMUDriverPtr driver, src->tlsCertdir, false, src->tlsVerify, - NULL, &tlsProps, NULL, NULL) < 0) + &tlsProps, NULL) < 0) goto cleanup; if (qemuDomainAddTLSObjects(driver, vm, QEMU_ASYNC_JOB_NONE, @@ -1498,9 +1498,7 @@ qemuDomainGetTLSObjects(virQEMUCapsPtr qemuCaps, const char *tlsCertdir, bool tlsListen, bool tlsVerify, - const char *srcAlias, virJSONValuePtr *tlsProps, - char **tlsAlias, virJSONValuePtr *secProps) { const char *secAlias = NULL; @@ -1516,10 +1514,6 @@ qemuDomainGetTLSObjects(virQEMUCapsPtr qemuCaps, secAlias, qemuCaps, tlsProps) < 0) return -1; - if (tlsAlias && - !(*tlsAlias = qemuAliasTLSObjFromSrcAlias(srcAlias))) - return -1; - return 0; } @@ -1559,12 +1553,14 @@ qemuDomainAddChardevTLSObjects(virQEMUDriverPtr driver, if (secinfo) *secAlias = secinfo->s.aes.alias; + if (!(*tlsAlias = qemuAliasTLSObjFromSrcAlias(charAlias))) + goto cleanup; + if (qemuDomainGetTLSObjects(priv->qemuCaps, secinfo, cfg->chardevTLSx509certdir, dev->data.tcp.listen, cfg->chardevTLSx509verify, - charAlias, &tlsProps, tlsAlias, - &secProps) < 0) + &tlsProps, &secProps) < 0) goto cleanup; dev->data.tcp.tlscreds = true; diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h index ec5a9b8198..2059baf47f 100644 --- a/src/qemu/qemu_hotplug.h +++ b/src/qemu/qemu_hotplug.h @@ -53,9 +53,7 @@ int qemuDomainGetTLSObjects(virQEMUCapsPtr qemuCaps, const char *tlsCertdir, bool tlsListen, bool tlsVerify, - const char *srcAlias, virJSONValuePtr *tlsProps, - char **tlsAlias, virJSONValuePtr *secProps); int qemuDomainAttachControllerDevice(virQEMUDriverPtr driver, diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_params.c index 42d72436fb..5976bfdaf2 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -856,11 +856,13 @@ qemuMigrationParamsEnableTLS(virQEMUDriverPtr driver, secAlias = priv->migSecinfo->s.aes.alias; } + if (!(*tlsAlias = qemuAliasTLSObjFromSrcAlias(QEMU_MIGRATION_TLS_ALIAS_BASE))) + goto error; + if (qemuDomainGetTLSObjects(priv->qemuCaps, priv->migSecinfo, cfg->migrateTLSx509certdir, tlsListen, cfg->migrateTLSx509verify, - QEMU_MIGRATION_TLS_ALIAS_BASE, - &tlsProps, tlsAlias, &secProps) < 0) + &tlsProps, &secProps) < 0) goto error; /* Ensure the domain doesn't already have the TLS objects defined... -- 2.16.2 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list