server: make snapshotting on KVM non-blocking (#3209)

* server: make snapshotting on KVM non-blocking

This references and uses an already fixed solution from
https://github.com/MissionCriticalCloud/cosmic/pull/68 to make
snapshotting on KVM non-blocking.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

* move StorageSubSystemCommand instanceof check above as CopyCommand is a type of StorageSubSystemCommand

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2019-03-25 13:57:21 +05:30 committed by GitHub
parent a3938b330a
commit 462a37d1b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -126,6 +126,10 @@ public class KVMGuru extends HypervisorGuruBase implements HypervisorGuru {
@Override
public Pair<Boolean, Long> getCommandHostDelegation(long hostId, Command cmd) {
if (cmd instanceof StorageSubSystemCommand) {
StorageSubSystemCommand c = (StorageSubSystemCommand)cmd;
c.setExecuteInSequence(false);
}
if (cmd instanceof CopyCommand) {
CopyCommand c = (CopyCommand) cmd;
boolean inSeq = true;
@ -137,12 +141,11 @@ public class KVMGuru extends HypervisorGuruBase implements HypervisorGuru {
inSeq = false;
}
c.setExecuteInSequence(inSeq);
if (c.getSrcTO().getHypervisorType() == HypervisorType.KVM) {
return new Pair<>(true, hostId);
}
}
if (cmd instanceof StorageSubSystemCommand) {
StorageSubSystemCommand c = (StorageSubSystemCommand)cmd;
c.setExecuteInSequence(false);
}
return new Pair<Boolean, Long>(false, new Long(hostId));
return new Pair<>(false, hostId);
}
@Override