Blame SOURCES/libvirt-qemu-hotplug-Remove-ret-variable-in-qemuDomainDetachDeviceDiskLive.patch

99cbc7
From 632d110740498e0aa6828dbfdbace81847b084ff Mon Sep 17 00:00:00 2001
99cbc7
Message-Id: <632d110740498e0aa6828dbfdbace81847b084ff@dist-git>
99cbc7
From: Peter Krempa <pkrempa@redhat.com>
99cbc7
Date: Thu, 11 Apr 2019 15:14:26 -0400
99cbc7
Subject: [PATCH] qemu: hotplug: Remove 'ret' variable in
99cbc7
 qemuDomainDetachDeviceDiskLive
99cbc7
MIME-Version: 1.0
99cbc7
Content-Type: text/plain; charset=UTF-8
99cbc7
Content-Transfer-Encoding: 8bit
99cbc7
99cbc7
We don't have any cleanup section, we can return the value directly.
99cbc7
99cbc7
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
99cbc7
Reviewed-by: Ján Tomko <jtomko@redhat.com>
99cbc7
(cherry picked from commit 70d06898128086e3daecd389db10315a3c361a60)
99cbc7
99cbc7
Partially-Resolves: https://bugzilla.redhat.com/1658198
99cbc7
Signed-off-by: Laine Stump <laine@redhat.com>
99cbc7
Signed-off-by: Laine Stump <laine@laine.org>
99cbc7
Message-Id: <20190411191453.24055-15-laine@redhat.com>
99cbc7
Acked-by: Michal Privoznik <mprivozn@redhat.com>
99cbc7
---
99cbc7
 src/qemu/qemu_hotplug.c | 7 +++----
99cbc7
 1 file changed, 3 insertions(+), 4 deletions(-)
99cbc7
99cbc7
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
99cbc7
index 1f41efa180..8047ac773f 100644
99cbc7
--- a/src/qemu/qemu_hotplug.c
99cbc7
+++ b/src/qemu/qemu_hotplug.c
99cbc7
@@ -4811,7 +4811,6 @@ qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
99cbc7
                                bool async)
99cbc7
 {
99cbc7
     virDomainDiskDefPtr disk;
99cbc7
-    int ret = -1;
99cbc7
     int idx;
99cbc7
 
99cbc7
     if ((idx = qemuFindDisk(vm->def, dev->data.disk->dst)) < 0) {
99cbc7
@@ -4825,10 +4824,10 @@ qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
99cbc7
     case VIR_DOMAIN_DISK_DEVICE_DISK:
99cbc7
     case VIR_DOMAIN_DISK_DEVICE_LUN:
99cbc7
         if (disk->bus == VIR_DOMAIN_DISK_BUS_VIRTIO)
99cbc7
-            ret = qemuDomainDetachVirtioDiskDevice(driver, vm, disk, async);
99cbc7
+            return qemuDomainDetachVirtioDiskDevice(driver, vm, disk, async);
99cbc7
         else if (disk->bus == VIR_DOMAIN_DISK_BUS_SCSI ||
99cbc7
                  disk->bus == VIR_DOMAIN_DISK_BUS_USB)
99cbc7
-            ret = qemuDomainDetachDiskDevice(driver, vm, disk, async);
99cbc7
+            return qemuDomainDetachDiskDevice(driver, vm, disk, async);
99cbc7
         else
99cbc7
             virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
99cbc7
                            _("This type of disk cannot be hot unplugged"));
99cbc7
@@ -4840,7 +4839,7 @@ qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
99cbc7
         break;
99cbc7
     }
99cbc7
 
99cbc7
-    return ret;
99cbc7
+    return -1;
99cbc7
 }
99cbc7
 
99cbc7
 
99cbc7
-- 
99cbc7
2.21.0
99cbc7