Arik Hadas has uploaded a new change for review.

Change subject: core: Remove VMStatus#isGuestUp method
......................................................................

core: Remove VMStatus#isGuestUp method

The method VMStatus#isGuestUp is removed.

The method was called from one place in VdsUpdateRunTimeInfo to
check whether the status of a VM that was in MigrationFrom status
changed to Up/PoweringDown/PoweredDown/PoweringUp in the source host,
which means that the migration failed and needs to be re-run.

The above call was replaced with a check that the VM is not in
MigrationFrom status and a call to VMStatus#isRunning - in those places
(which include WaitForLaunch + RebootInProgress in addition to the
statuses mentioned above) we want the migration process to re-run.

Change-Id: Iab3535e3bd6abaf61b244ac456bb93eb0218174e
Signed-off-by: Arik Hadas <[email protected]>
---
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VMStatus.java
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java
2 files changed, 2 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/78/10978/1

diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VMStatus.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VMStatus.java
index 2dc2e70..b5617a1 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VMStatus.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VMStatus.java
@@ -45,15 +45,6 @@
     }
 
     /**
-     * This method reflects whether it's a VM status in which the guest is up
-     *
-     * @return true if this status indicates that the guest is up, otherwise 
false
-     */
-    public boolean isGuestUp() {
-        return this == Up || this == PoweringDown || this == PoweredDown || 
this == PoweringUp;
-    }
-
-    /**
      * This method reflects whether the VM is surely not running in this status
      *
      * <p>Note: There might be cases in which the VM is not running and this 
method
diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java
index 99e0dc5..1fe5220 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java
@@ -1495,8 +1495,9 @@
 
     private void afterMigrationFrom(VmDynamic runningVm, VM vmToUpdate) {
         VMStatus oldVmStatus = vmToUpdate.getStatus();
+        VMStatus currentVmStatus = runningVm.getstatus();
 
-        if (oldVmStatus == VMStatus.MigratingFrom && 
runningVm.getstatus().isGuestUp()) {
+        if (oldVmStatus == VMStatus.MigratingFrom && currentVmStatus != 
VMStatus.MigratingFrom && currentVmStatus.isRunning()) {
             _vmsToRerun.add(runningVm.getId());
             log.infoFormat("adding VM {0} to re-run list", runningVm.getId());
             vmToUpdate.setMigratingToVds(null);


--
To view, visit http://gerrit.ovirt.org/10978
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iab3535e3bd6abaf61b244ac456bb93eb0218174e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Arik Hadas <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to