Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make snapshotting on KVM non-blocking #68

Merged
merged 1 commit into from
Sep 1, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions cosmic-core/server/src/main/java/com/cloud/hypervisor/KVMGuru.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.cloud.agent.api.Command;
import com.cloud.agent.api.to.DataObjectType;
import com.cloud.agent.api.to.DataTO;
import com.cloud.agent.api.to.VirtualMachineTO;
import com.cloud.host.HostVO;
import com.cloud.host.dao.HostDao;
Expand Down Expand Up @@ -33,8 +34,14 @@ protected KVMGuru() {

@Override
public Pair<Boolean, Long> getCommandHostDelegation(final long hostId, final Command cmd) {

if (cmd instanceof StorageSubSystemCommand) {
final StorageSubSystemCommand c = (StorageSubSystemCommand) cmd;
c.setExecuteInSequence(false);
}
if (cmd instanceof CopyCommand) {
final CopyCommand c = (CopyCommand) cmd;
final DataTO srcData = c.getSrcTO();
boolean inSeq = true;
if (c.getSrcTO().getObjectType() == DataObjectType.SNAPSHOT ||
c.getDestTO().getObjectType() == DataObjectType.SNAPSHOT) {
Expand All @@ -44,11 +51,11 @@ public Pair<Boolean, Long> getCommandHostDelegation(final long hostId, final Com
inSeq = false;
}
c.setExecuteInSequence(inSeq);
if (srcData.getHypervisorType() == HypervisorType.KVM) {
return new Pair<>(true, new Long(hostId));
}
}
if (cmd instanceof StorageSubSystemCommand) {
final StorageSubSystemCommand c = (StorageSubSystemCommand) cmd;
c.setExecuteInSequence(false);
}

return new Pair<>(false, new Long(hostId));
}

Expand Down