Blob Blame History Raw
From c96a89bd5962a945f6097af4fa7264446cba613f Mon Sep 17 00:00:00 2001
Message-Id: <c96a89bd5962a945f6097af4fa7264446cba613f@dist-git>
From: Peter Krempa <pkrempa@redhat.com>
Date: Tue, 10 Jul 2018 17:41:10 +0200
Subject: [PATCH] qemu: hotplug: Do not try to add secret object for TLS if it
 does not exist
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The check whether the object holding secret for decryption of the TLS
environment was wrong and would always attempt to add the object. This
lead to a crash due to recent refactors.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1598015

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit 62ef8227e2717618c96fa17f2d4f5b7570bbe980)
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
 src/qemu/qemu_hotplug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 075f2fb72e..456bfa4493 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1338,7 +1338,7 @@ qemuDomainAddTLSObjects(virQEMUDriverPtr driver,
     if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
         return -1;
 
-    if (secProps &&
+    if (secProps && *secProps &&
         qemuMonitorAddObject(priv->mon, secProps, &secAlias) < 0)
         goto error;
 
-- 
2.18.0