[PATCH] qemu: kill some dead stores

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Spotted by clang.  The qemuConnectMonitor one is an outright bug,
the other two are cosmetic.

* src/qemu/qemu_monitor.c (qemuMonitorClose): Kill dead store.
* src/qemu/qemu_driver.c (qemudDomainSaveImageStartVM): Likewise.
(qemuConnectMonitor): Don't lose error status.
---
 src/qemu/qemu_driver.c  |    2 --
 src/qemu/qemu_monitor.c |    4 +---
 2 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 098f4da..57b8271 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1416,7 +1416,6 @@ qemuConnectMonitor(struct qemud_driver *driver, virDomainObjPtr vm)
     ret = qemuMonitorSetCapabilities(priv->mon);
     qemuDomainObjExitMonitorWithDriver(driver, vm);

-    ret = 0;
 error:
     if (ret < 0)
         qemuMonitorClose(priv->mon);
@@ -6535,7 +6534,6 @@ qemudDomainSaveImageStartVM(virConnectPtr conn,
     wait_ret = qemudDomainSaveImageClose(fd, read_pid, &status);
     fd = -1;
     if (read_pid != -1) {
-        read_pid = -1;
         if (wait_ret == -1) {
             virReportSystemError(errno,
                                  _("failed to wait for process reading '%s'"),
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index f1494ff..2366fdb 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -685,8 +685,6 @@ cleanup:

 void qemuMonitorClose(qemuMonitorPtr mon)
 {
-    int refs;
-
     if (!mon)
         return;

@@ -706,7 +704,7 @@ void qemuMonitorClose(qemuMonitorPtr mon)
         mon->closed = 1;
     }

-    if ((refs = qemuMonitorUnref(mon)) > 0)
+    if (qemuMonitorUnref(mon) > 0)
         qemuMonitorUnlock(mon);
 }

-- 
1.7.2

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


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]