From 350e8938cf0c1f673aa115fd2fc073e47b9a3403 Mon Sep 17 00:00:00 2001 From: Edison Su Date: Fri, 27 Sep 2013 16:09:22 -0700 Subject: [PATCH] CLOUDSTACK-4754: it's a race condition: delete template, and deploy vm from the template happened at the same time, --- .../cloudstack/storage/motion/DataMotionServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/DataMotionServiceImpl.java b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/DataMotionServiceImpl.java index c1cbdc772cc..9f0f5311a28 100644 --- a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/DataMotionServiceImpl.java +++ b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/DataMotionServiceImpl.java @@ -41,6 +41,9 @@ public class DataMotionServiceImpl implements DataMotionService { @Override public void copyAsync(DataObject srcData, DataObject destData, AsyncCompletionCallback callback) { + if (srcData.getDataStore() == null || destData.getDataStore() == null) { + throw new CloudRuntimeException("can't find data store"); + } if (srcData.getDataStore().getDriver().canCopy(srcData, destData)) { srcData.getDataStore().getDriver().copyAsync(srcData, destData, callback);