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

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