From 5300f68cda3743460278df0e080335619d6be655 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Tue, 12 Mar 2019 10:47:47 +0530 Subject: [PATCH 1/2] 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 --- server/src/main/java/com/cloud/hypervisor/KVMGuru.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/com/cloud/hypervisor/KVMGuru.java b/server/src/main/java/com/cloud/hypervisor/KVMGuru.java index df6038d715a8..293d1f468aaf 100644 --- a/server/src/main/java/com/cloud/hypervisor/KVMGuru.java +++ b/server/src/main/java/com/cloud/hypervisor/KVMGuru.java @@ -137,12 +137,15 @@ public Pair getCommandHostDelegation(long hostId, Command cmd) { 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(false, new Long(hostId)); + return new Pair<>(false, hostId); } @Override From 1a1566372014ce78b1f727b04ae14f2ef8bc8302 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Tue, 12 Mar 2019 11:04:26 +0530 Subject: [PATCH 2/2] move StorageSubSystemCommand instanceof check above as CopyCommand is a type of StorageSubSystemCommand Signed-off-by: Rohit Yadav --- server/src/main/java/com/cloud/hypervisor/KVMGuru.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/com/cloud/hypervisor/KVMGuru.java b/server/src/main/java/com/cloud/hypervisor/KVMGuru.java index 293d1f468aaf..c512f06a4fd8 100644 --- a/server/src/main/java/com/cloud/hypervisor/KVMGuru.java +++ b/server/src/main/java/com/cloud/hypervisor/KVMGuru.java @@ -126,6 +126,10 @@ public VirtualMachineTO implement(VirtualMachineProfile vm) { @Override public Pair 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; @@ -141,10 +145,6 @@ public Pair getCommandHostDelegation(long hostId, Command cmd) { return new Pair<>(true, hostId); } } - if (cmd instanceof StorageSubSystemCommand) { - StorageSubSystemCommand c = (StorageSubSystemCommand)cmd; - c.setExecuteInSequence(false); - } return new Pair<>(false, hostId); }