From 93204ae8624e6309db6ae5d7edc4ae83e85830ad Mon Sep 17 00:00:00 2001 From: Nitin Date: Wed, 10 Aug 2011 18:18:35 +0530 Subject: [PATCH] bug 4957: copyTemplate: should compare template_host_ref.size to configuration.max.template.iso.size values before sending command to the backend . status 4957: resolved fixed --- .../src/com/cloud/storage/download/DownloadMonitorImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/src/com/cloud/storage/download/DownloadMonitorImpl.java b/server/src/com/cloud/storage/download/DownloadMonitorImpl.java index ea142137dc3..064c9660bcf 100755 --- a/server/src/com/cloud/storage/download/DownloadMonitorImpl.java +++ b/server/src/com/cloud/storage/download/DownloadMonitorImpl.java @@ -234,6 +234,10 @@ public class DownloadMonitorImpl implements DownloadMonitor { } Long maxTemplateSizeInBytes = getMaxTemplateSizeInBytes(); + if (srcTmpltHost.getSize() > maxTemplateSizeInBytes){ + throw new CloudRuntimeException("Cant copy the template as the template's size " +srcTmpltHost.getSize()+ + " is greater than max.template.iso.size " + maxTemplateSizeInBytes); + } if(destTmpltHost != null) { start();