From nobody Wed May 14 16:55:11 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1527684210612892.0722652518484; Wed, 30 May 2018 05:43:30 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4230130BC1F3; Wed, 30 May 2018 12:43:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 03CAA2010CD3; Wed, 30 May 2018 12:43:29 +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 7D8E1180121E; Wed, 30 May 2018 12:43:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4UCg7YS027665 for ; Wed, 30 May 2018 08:42:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 032D5217B40A; Wed, 30 May 2018 12:42:07 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9C0CD217B409 for ; Wed, 30 May 2018 12:42:06 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 30 May 2018 14:41:27 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 31/38] qemu: command: Always setup TLS environment if src->haveTLS is on 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Wed, 30 May 2018 12:43:29 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We make sure that the disk supports TLS when preparing the environment so there's no need to duplicate checks. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_command.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 2ed58befd9..134e1a3a20 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -766,8 +766,6 @@ qemuBuildTLSx509CommandLine(virCommandPtr cmd, /* qemuBuildDiskSrcTLSx509CommandLine: - * - * Add TLS object if the disk src uses a secure communication channel * * Returns 0 on success, -1 w/ error on some sort of failure. */ @@ -776,17 +774,12 @@ qemuBuildDiskSrcTLSx509CommandLine(virCommandPtr cmd, virStorageSourcePtr src, virQEMUCapsPtr qemuCaps) { + if (src->haveTLS !=3D VIR_TRISTATE_BOOL_YES) + return 0; - - /* other protocols may be added later */ - if (src->protocol =3D=3D VIR_STORAGE_NET_PROTOCOL_VXHS && - src->haveTLS =3D=3D VIR_TRISTATE_BOOL_YES) { - return qemuBuildTLSx509CommandLine(cmd, src->tlsCertdir, - false, src->tlsVerify, - NULL, src->tlsAlias, qemuCaps); - } - - return 0; + return qemuBuildTLSx509CommandLine(cmd, src->tlsCertdir, + false, src->tlsVerify, + NULL, src->tlsAlias, qemuCaps); } --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list