Blob Blame History Raw
From a67d5e7badd536eae52b575a02e9e146e42b26a2 Mon Sep 17 00:00:00 2001
Message-Id: <a67d5e7badd536eae52b575a02e9e146e42b26a2@dist-git>
From: John Ferlan <jferlan@redhat.com>
Date: Mon, 25 Jul 2016 12:43:01 -0400
Subject: [PATCH] qemu: Move setting of obj bools for
 qemuDomainAttachVirtioDiskDevice

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

A post push realization that the setting of the boolean needed to be
inside the if condition.

(cherry picked from commit c144f14c120a3b4fd3b7cf87bf0bbc30183464a0)
Signed-off-by: John Ferlan <jferlan@redhat.com>
---
 src/qemu/qemu_hotplug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 6509867..1fa1010 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -383,8 +383,8 @@ qemuDomainAttachVirtioDiskDevice(virConnectPtr conn,
         secobjProps = NULL; /* qemuMonitorAddObject consumes */
         if (rv < 0)
             goto exit_monitor;
+        secobjAdded = true;
     }
-    secobjAdded = true;
 
     if (encobjProps) {
         rv = qemuMonitorAddObject(priv->mon, "secret", encinfo->s.aes.alias,
@@ -392,8 +392,8 @@ qemuDomainAttachVirtioDiskDevice(virConnectPtr conn,
         encobjProps = NULL; /* qemuMonitorAddObject consumes */
         if (rv < 0)
             goto exit_monitor;
+        encobjAdded = true;
     }
-    encobjAdded = true;
 
     if (qemuMonitorAddDrive(priv->mon, drivestr) < 0)
         goto exit_monitor;
-- 
2.9.2