Arik Hadas has uploaded a new change for review.

Change subject: core: fix wrong audit log on stop vm with hibernation vols
......................................................................

core: fix wrong audit log on stop vm with hibernation vols

While stopping VM which is not suspended but has hibernation volumes (it
could happen if we didn't manage to remove them when the VM reached UP
state), the audit log described the operation as stopping suspended VM
which is incorrect. This patch change this audit log such that the VM
won't be described as suspended VM.

Change-Id: If4ee5275477e989930a4c284a211755ebff76e33
Signed-off-by: Arik Hadas <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/StopVmCommandBase.java
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/93/17693/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/StopVmCommandBase.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/StopVmCommandBase.java
index 3eff06a..a5ec380 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/StopVmCommandBase.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/StopVmCommandBase.java
@@ -83,9 +83,10 @@
     @Override
     protected void executeVmCommand() {
         getParameters().setEntityInfo(new EntityInfo(VdcObjectType.VM, 
getVm().getId()));
-        if (getVm().getStatus() == VMStatus.Suspended
-                || StringUtils.isNotEmpty(getVm().getHibernationVolHandle())) {
-            suspendedVm = true;
+        // Mark that the stopped vm was suspended before for audit log messages
+        suspendedVm = getVm().getStatus() == VMStatus.Suspended;
+
+        if (suspendedVm || 
StringUtils.isNotEmpty(getVm().getHibernationVolHandle())) {
             setSucceeded(stopSuspendedVm());
 
             // the following is true when the hibernation volumes don't exist


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If4ee5275477e989930a4c284a211755ebff76e33
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