CLOUDSTACK-5696: fix a regression caused by out-of-band sync changes

This commit is contained in:
Kelven Yang 2014-01-15 16:21:05 -08:00
parent 5c77725090
commit 1acdbf8369
2 changed files with 12 additions and 9 deletions

View File

@ -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<VirtualMachine.State> {
@ -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();

View File

@ -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());