[libvirt] [PATCH 10/3] qemu: remove dead code

Eric Blake eblake at redhat.com
Tue Aug 2 20:20:07 UTC 2011


Warning detected by Coverity.  No need for the NULL check, and
removing it silences the warning without any semantic change.

* src/qemu/qemu_migration.c (qemuMigrationFinish): All entries to
endjob had non-NULL vm.
---

Oops - I forgot to label the subject for 9/3 properly.

 src/qemu/qemu_migration.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 8bdbcaf..7aeea69 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2569,13 +2569,11 @@ qemuMigrationFinish(struct qemud_driver *driver,
         VIR_WARN("Unable to encode migration cookie");

 endjob:
-    if (vm) {
-        if (qemuMigrationJobFinish(driver, vm) == 0) {
-            vm = NULL;
-        } else if (!vm->persistent && !virDomainObjIsActive(vm)) {
-            virDomainRemoveInactive(&driver->domains, vm);
-            vm = NULL;
-        }
+    if (qemuMigrationJobFinish(driver, vm) == 0) {
+        vm = NULL;
+    } else if (!vm->persistent && !virDomainObjIsActive(vm)) {
+        virDomainRemoveInactive(&driver->domains, vm);
+        vm = NULL;
     }

 cleanup:
-- 
1.7.4.4




More information about the libvir-list mailing list