Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8C43D10E06 for ; Tue, 30 Jul 2013 11:26:49 +0000 (UTC) Received: (qmail 35687 invoked by uid 500); 30 Jul 2013 11:26:47 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 35677 invoked by uid 500); 30 Jul 2013 11:26:46 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 35670 invoked by uid 99); 30 Jul 2013 11:26:45 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Jul 2013 11:26:45 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 2D96731A66A; Tue, 30 Jul 2013 11:26:45 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: koushik@apache.org To: commits@cloudstack.apache.org Message-Id: <11a13b950e6b48c08d45514279efcaef@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/master to 62a71e0 Date: Tue, 30 Jul 2013 11:26:45 +0000 (UTC) Updated Branches: refs/heads/master 452176c0b -> 62a71e055 CLOUDSTACK-3937: Attaching uploaded volume is failing The method getCommandHostDelegation(long hostId, Command cmid) got overidden in VmwareGuru.java as part of commit bfe30cd2e31906365a306d87fe331ccdcec5c33c. Earlier there was no HV specific implementation and copy volume from secondary to primary worked fine. With the Vmware specific change the code was getting hit even in case of XS and other hypervisors and failed with NPE. Now there is a check in the Vmware implementation to check if the HV is of type Vmware. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/62a71e05 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/62a71e05 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/62a71e05 Branch: refs/heads/master Commit: 62a71e055bbd69a195258f6fc871378070efdcc2 Parents: 452176c Author: Koushik Das Authored: Tue Jul 30 16:23:02 2013 +0530 Committer: Koushik Das Committed: Tue Jul 30 16:56:15 2013 +0530 ---------------------------------------------------------------------- .../vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/62a71e05/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java index c1b5dfa..7d0c12a 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java @@ -300,6 +300,11 @@ public class VMwareGuru extends HypervisorGuruBase implements HypervisorGuru { public Pair getCommandHostDelegation(long hostId, Command cmd) { boolean needDelegation = false; + HostVO host = _hostDao.findById(hostId); + if (host.getHypervisorType() != HypervisorType.VMware) { + return new Pair(Boolean.FALSE, new Long(hostId)); + } + if (cmd instanceof CopyCommand) { CopyCommand cpyCommand = (CopyCommand)cmd; DataTO srcData = cpyCommand.getSrcTO(); @@ -343,9 +348,7 @@ public class VMwareGuru extends HypervisorGuruBase implements HypervisorGuru { return new Pair(Boolean.FALSE, new Long(hostId)); } - HostVO host = _hostDao.findById(hostId); long dcId = host.getDataCenterId(); - Pair cmdTarget = _secStorageMgr.assignSecStorageVm(dcId, cmd); if(cmdTarget != null) { // TODO, we need to make sure agent is actually connected too