[libvirt] [PATCH 31/38] qemu: command: Always setup TLS environment if src->haveTLS is on

Peter Krempa posted 38 patches 6 years, 11 months ago
[libvirt] [PATCH 31/38] qemu: command: Always setup TLS environment if src->haveTLS is on
Posted by Peter Krempa 6 years, 11 months ago
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 <pkrempa@redhat.com>
---
 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 != VIR_TRISTATE_BOOL_YES)
+        return 0;

-
-    /* other protocols may be added later */
-    if (src->protocol == VIR_STORAGE_NET_PROTOCOL_VXHS &&
-        src->haveTLS == 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);
 }


-- 
2.16.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 31/38] qemu: command: Always setup TLS environment if src->haveTLS is on
Posted by Ján Tomko 6 years, 11 months ago
On Wed, May 30, 2018 at 02:41:27PM +0200, Peter Krempa wrote:
>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 <pkrempa@redhat.com>
>---
> src/qemu/qemu_command.c | 17 +++++------------
> 1 file changed, 5 insertions(+), 12 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list