Skip to content

Commit fc18d1e

Browse files
committed
CLOUDSTACK-8964 side effect isolation
extract side effect away to emphasize the main commandDelegation objective
1 parent c4afb76 commit fc18d1e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

plugins/hypervisors/ovm3/src/main/java/com/cloud/hypervisor/ovm3/resources/Ovm3HypervisorGuru.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,15 @@ public boolean trackVmHostChange() {
8787
*/
8888
public Pair<Boolean, Long> getCommandHostDelegation(long hostId, Command cmd) {
8989
LOGGER.debug("getCommandHostDelegation: " + cmd.getClass());
90+
performSideEffectsForDelegationOnCommand(hostId, cmd);
91+
return new Pair<Boolean, Long>(Boolean.FALSE, Long.valueOf(hostId));
92+
}
93+
94+
/**
95+
* @param hostId
96+
* @param cmd
97+
*/
98+
void performSideEffectsForDelegationOnCommand(long hostId, Command cmd) {
9099
if (cmd instanceof StorageSubSystemCommand) {
91100
StorageSubSystemCommand c = (StorageSubSystemCommand)cmd;
92101
c.setExecuteInSequence(true);
@@ -108,6 +117,5 @@ public Pair<Boolean, Long> getCommandHostDelegation(long hostId, Command cmd) {
108117
}
109118
}
110119
}
111-
return new Pair<Boolean, Long>(Boolean.FALSE, Long.valueOf(hostId));
112120
}
113121
}

0 commit comments

Comments
 (0)