From nobody Mon Feb 9 16:53:48 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1632411487; cv=none; d=zohomail.com; s=zohoarc; b=ggsqzvDXwsTjlQvNFplnhocQuPdnkalFxNP7dcQdSV+Zgfac9PiqKdZD9cHyMywX79pu97/Q6HnAnnyWhKrmI6quMq7fvm06UCJb9z21PWVcAk82fzKCTB9yo2pji48Rq76gBC6le75jv3XhL6L4BUYnoxXB20Z2R9LxuMh/X8c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632411487; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ndFvzrGLNsErVmX6P1XRr/gR+OQUMkU7VZuhkChJi3M=; b=D/uFDG8ZN1c1AMxcZJ6rz+NhK9xkmonoU10Ivou6bNiJmZoURYpioC0c52tOMuN1BsUHi8PhfhHwjmRM17awrf5Gv80OzWxkI/xEd6vk6qSKv5AFMJc6VxYkGmgvX3x1jhT2eJGz6wqZhad3yqtIsPoRNKJ+B0GA/TgtdWkWxDM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1632411487319400.8407068223455; Thu, 23 Sep 2021 08:38:07 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-143-QU6GP64iMWaGWPXb9gGWpw-1; Thu, 23 Sep 2021 11:38:04 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E4E98101D60D; Thu, 23 Sep 2021 15:37:41 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7D7D85FC23; Thu, 23 Sep 2021 15:37:41 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 432774EA37; Thu, 23 Sep 2021 15:37:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18NFbTEv000511 for ; Thu, 23 Sep 2021 11:37:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 41D0E102AE48; Thu, 23 Sep 2021 15:37:29 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 903481024893 for ; Thu, 23 Sep 2021 15:37:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632411486; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ndFvzrGLNsErVmX6P1XRr/gR+OQUMkU7VZuhkChJi3M=; b=GmDGFm2qzbD+q4Hbls1xyCM4fbYNwGTqGq9yxZOpn/NHG+xTxeddlg3x9AUEHEqZ7zAFfc cjAZVVgLtx0Ythtet3rAeFax7p202zVhjqd+uyiMivxVT/ttor+4E7kp+Zvhk+GaS7pf5f G39w9GpDbh6lYV+WK5Dmzhc29+26SQw= X-MC-Unique: QU6GP64iMWaGWPXb9gGWpw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 05/14] qemu: command: Simplify 'vnc' commandline generator Date: Thu, 23 Sep 2021 17:37:11 +0200 Message-Id: <61a3eb92163111f32f0d2b0e572a4feec8b6e7e3.1632411336.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1632411487753100001 Content-Type: text/plain; charset="utf-8" '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=3D' parameter. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 48 +++++++++++++++-------------------------- 1 file changed, 17 insertions(+), 31 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index a8d2b1ce74..08c88b12f4 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7963,40 +7963,26 @@ qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfig= *cfg, if (cfg->vncTLS) { qemuDomainGraphicsPrivate *gfxPriv =3D QEMU_DOMAIN_GRAPHICS_PRIVAT= E(graphics); - if (gfxPriv->tlsAlias) { - const char *secretAlias =3D NULL; + const char *secretAlias =3D NULL; - if (gfxPriv->secinfo) { - if (qemuBuildObjectSecretCommandLine(cmd, - gfxPriv->secinfo, - qemuCaps) < 0) - return -1; - secretAlias =3D gfxPriv->secinfo->alias; - } - - if (qemuBuildTLSx509CommandLine(cmd, - cfg->vncTLSx509certdir, - true, - cfg->vncTLSx509verify, - secretAlias, - gfxPriv->tlsAlias, - qemuCaps) < 0) + if (gfxPriv->secinfo) { + if (qemuBuildObjectSecretCommandLine(cmd, + gfxPriv->secinfo, + qemuCaps) < 0) return -1; - - virBufferAsprintf(&opt, ",tls-creds=3D%s", gfxPriv->tlsAlias); - } else { - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VNC_OPTS)) - virBufferAddLit(&opt, ",tls=3Don"); - else - virBufferAddLit(&opt, ",tls"); - if (cfg->vncTLSx509verify) { - virBufferAddLit(&opt, ",x509verify=3D"); - virQEMUBuildBufferEscapeComma(&opt, cfg->vncTLSx509certdir= ); - } else { - virBufferAddLit(&opt, ",x509=3D"); - virQEMUBuildBufferEscapeComma(&opt, cfg->vncTLSx509certdir= ); - } + secretAlias =3D gfxPriv->secinfo->alias; } + + if (qemuBuildTLSx509CommandLine(cmd, + cfg->vncTLSx509certdir, + true, + cfg->vncTLSx509verify, + secretAlias, + gfxPriv->tlsAlias, + qemuCaps) < 0) + return -1; + + virBufferAsprintf(&opt, ",tls-creds=3D%s", gfxPriv->tlsAlias); } if (cfg->vncSASL) { --=20 2.31.1