qemu: command: Simplify 'vnc' commandline generator
'qemuDomainSecretGraphicsPrepare' always populates 'gfxPriv->tlsAlias' when 'cfg->vncTLS' is enabled. This means we can remove the fallback code setting up TLS for vnc via the 'x509=' parameter. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
33ebfe3756
commit
01c65d761c
@ -7963,40 +7963,26 @@ qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfig *cfg,
|
|||||||
|
|
||||||
if (cfg->vncTLS) {
|
if (cfg->vncTLS) {
|
||||||
qemuDomainGraphicsPrivate *gfxPriv = QEMU_DOMAIN_GRAPHICS_PRIVATE(graphics);
|
qemuDomainGraphicsPrivate *gfxPriv = QEMU_DOMAIN_GRAPHICS_PRIVATE(graphics);
|
||||||
if (gfxPriv->tlsAlias) {
|
const char *secretAlias = NULL;
|
||||||
const char *secretAlias = NULL;
|
|
||||||
|
|
||||||
if (gfxPriv->secinfo) {
|
if (gfxPriv->secinfo) {
|
||||||
if (qemuBuildObjectSecretCommandLine(cmd,
|
if (qemuBuildObjectSecretCommandLine(cmd,
|
||||||
gfxPriv->secinfo,
|
gfxPriv->secinfo,
|
||||||
qemuCaps) < 0)
|
qemuCaps) < 0)
|
||||||
return -1;
|
|
||||||
secretAlias = gfxPriv->secinfo->alias;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (qemuBuildTLSx509CommandLine(cmd,
|
|
||||||
cfg->vncTLSx509certdir,
|
|
||||||
true,
|
|
||||||
cfg->vncTLSx509verify,
|
|
||||||
secretAlias,
|
|
||||||
gfxPriv->tlsAlias,
|
|
||||||
qemuCaps) < 0)
|
|
||||||
return -1;
|
return -1;
|
||||||
|
secretAlias = gfxPriv->secinfo->alias;
|
||||||
virBufferAsprintf(&opt, ",tls-creds=%s", gfxPriv->tlsAlias);
|
|
||||||
} else {
|
|
||||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VNC_OPTS))
|
|
||||||
virBufferAddLit(&opt, ",tls=on");
|
|
||||||
else
|
|
||||||
virBufferAddLit(&opt, ",tls");
|
|
||||||
if (cfg->vncTLSx509verify) {
|
|
||||||
virBufferAddLit(&opt, ",x509verify=");
|
|
||||||
virQEMUBuildBufferEscapeComma(&opt, cfg->vncTLSx509certdir);
|
|
||||||
} else {
|
|
||||||
virBufferAddLit(&opt, ",x509=");
|
|
||||||
virQEMUBuildBufferEscapeComma(&opt, cfg->vncTLSx509certdir);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (qemuBuildTLSx509CommandLine(cmd,
|
||||||
|
cfg->vncTLSx509certdir,
|
||||||
|
true,
|
||||||
|
cfg->vncTLSx509verify,
|
||||||
|
secretAlias,
|
||||||
|
gfxPriv->tlsAlias,
|
||||||
|
qemuCaps) < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
virBufferAsprintf(&opt, ",tls-creds=%s", gfxPriv->tlsAlias);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cfg->vncSASL) {
|
if (cfg->vncSASL) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user