From 1acdbf8369c68fc99d8ea06204895cb55965d49a Mon Sep 17 00:00:00 2001 From: Kelven Yang Date: Wed, 15 Jan 2014 16:21:05 -0800 Subject: [PATCH] CLOUDSTACK-5696: fix a regression caused by out-of-band sync changes --- api/src/com/cloud/vm/VirtualMachine.java | 17 +++++++++-------- .../jobs/impl/AsyncJobManagerImpl.java | 4 +++- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/api/src/com/cloud/vm/VirtualMachine.java b/api/src/com/cloud/vm/VirtualMachine.java index 34008989d2b..b88df22719a 100755 --- a/api/src/com/cloud/vm/VirtualMachine.java +++ b/api/src/com/cloud/vm/VirtualMachine.java @@ -29,7 +29,7 @@ import com.cloud.utils.fsm.StateObject; /** * VirtualMachine describes the properties held by a virtual machine - * + * */ public interface VirtualMachine extends RunningOn, ControlledEntity, Identity, InternalIdentity, StateObject { @@ -117,7 +117,7 @@ public interface VirtualMachine extends RunningOn, ControlledEntity, Identity, I s_fsm.addTransition(State.Expunging, VirtualMachine.Event.ExpungeOperation, State.Expunging); s_fsm.addTransition(State.Error, VirtualMachine.Event.DestroyRequested, State.Expunging); s_fsm.addTransition(State.Error, VirtualMachine.Event.ExpungeOperation, State.Expunging); - + s_fsm.addTransition(State.Stopping, VirtualMachine.Event.FollowAgentPowerOnReport, State.Running); s_fsm.addTransition(State.Stopped, VirtualMachine.Event.FollowAgentPowerOnReport, State.Running); s_fsm.addTransition(State.Running, VirtualMachine.Event.FollowAgentPowerOnReport, State.Running); @@ -126,8 +126,9 @@ public interface VirtualMachine extends RunningOn, ControlledEntity, Identity, I s_fsm.addTransition(State.Stopping, VirtualMachine.Event.FollowAgentPowerOffReport, State.Stopped); s_fsm.addTransition(State.Running, VirtualMachine.Event.FollowAgentPowerOffReport, State.Stopped); s_fsm.addTransition(State.Migrating, VirtualMachine.Event.FollowAgentPowerOffReport, State.Stopped); + s_fsm.addTransition(State.Stopped, VirtualMachine.Event.FollowAgentPowerOffReport, State.Stopped); } - + public static boolean isVmStarted(State oldState, Event e, State newState) { if (oldState == State.Starting && newState == State.Running) { return true; @@ -194,10 +195,10 @@ public interface VirtualMachine extends RunningOn, ControlledEntity, Identity, I AgentReportMigrated, RevertRequested, SnapshotRequested, - + // added for new VMSync logic FollowAgentPowerOnReport, - FollowAgentPowerOffReport, + FollowAgentPowerOffReport, }; public enum Type { @@ -214,7 +215,7 @@ public interface VirtualMachine extends RunningOn, ControlledEntity, Identity, I * VM with this type. UserBareMetal should treat exactly as User. */ UserBareMetal(false), - + /* * General VM type for queuing VM orchestration work */ @@ -274,7 +275,7 @@ public interface VirtualMachine extends RunningOn, ControlledEntity, Identity, I /** * returns the guest OS ID - * + * * @return guestOSId */ long getGuestOSId(); @@ -313,7 +314,7 @@ public interface VirtualMachine extends RunningOn, ControlledEntity, Identity, I Date getCreated(); long getServiceOfferingId(); - + Long getDiskOfferingId(); Type getType(); diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java index cf7da81fd26..a77f864653e 100644 --- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java +++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java @@ -516,7 +516,9 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager, if (jobDispatcher != null) { jobDispatcher.runJob(job); } else { - s_logger.error("Unable to find a wakeup dispatcher from the joined job: " + job); + // TODO, job wakeup is not in use yet + if (s_logger.isTraceEnabled()) + s_logger.trace("Unable to find a wakeup dispatcher from the joined job: " + job); } } else { AsyncJobDispatcher jobDispatcher = getDispatcher(job.getDispatcher());