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 12C82D702 for ; Sat, 18 May 2013 15:14:12 +0000 (UTC) Received: (qmail 48458 invoked by uid 500); 18 May 2013 15:14:12 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 48439 invoked by uid 500); 18 May 2013 15:14:12 -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 48430 invoked by uid 99); 18 May 2013 15:14:12 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 May 2013 15:14:12 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id F02FC319579; Sat, 18 May 2013 15:14:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tsp@apache.org To: commits@cloudstack.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/2554 to 77d18cf Date: Sat, 18 May 2013 15:14:11 +0000 (UTC) Updated Branches: refs/heads/2554 0c74d9bfd -> 77d18cff5 Include a new resource ala XenServers for XCP1.6 Since the new system VMs use debian 6.0 it's hard to get the old XcpServerResource to behave right for Xcp 1.6. Hypervisor Version information is not maintained by the resource making it difficult to extend as guest OS types change and our systemVMs progress. The fix will allow XCP 1.6 to work with the new systemVM templates that use Debian Squeeze and the older XCPs to work as is. Signed-off-by: Prasanna Santhanam Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/77d18cff Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/77d18cff Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/77d18cff Branch: refs/heads/2554 Commit: 77d18cff5b53d58db049368e481c3ce2da835ece Parents: 0c74d9b Author: Prasanna Santhanam Authored: Sat May 18 20:41:19 2013 +0530 Committer: Prasanna Santhanam Committed: Sat May 18 20:41:19 2013 +0530 ---------------------------------------------------------------------- .../xen/discoverer/XcpServerDiscoverer.java | 8 ++-- .../hypervisor/xen/resource/CitrixHelper.java | 4 +- .../xen/resource/XcpServer16Resource.java | 32 +++++++++++++++ .../hypervisor/xen/resource/XcpServerResource.java | 19 +-------- 4 files changed, 39 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/77d18cff/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java index 5c04b34..31bb1a3 100755 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java @@ -47,6 +47,7 @@ import com.cloud.hypervisor.Hypervisor; import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.hypervisor.xen.resource.CitrixResourceBase; import com.cloud.hypervisor.xen.resource.XcpOssResource; +import com.cloud.hypervisor.xen.resource.XcpServer16Resource; import com.cloud.hypervisor.xen.resource.XcpServerResource; import com.cloud.hypervisor.xen.resource.XenServer56FP1Resource; import com.cloud.hypervisor.xen.resource.XenServer56Resource; @@ -432,11 +433,10 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, L || prodVersion.equals("1.1.0") || prodVersion.equals("5.6.100") || prodVersion.startsWith("1.4") - || prodVersion.startsWith("1.6") )) { - XcpServerResource xcpresource = new XcpServerResource(); - xcpresource.setVersion(prodVersion); - return xcpresource; + return new XcpServerResource(); + } else if (prodBrand.equals("XCP") && prodVersion.startsWith("1.6")) { + return new XcpServer16Resource(); } // Citrix Xenserver group of hypervisors http://git-wip-us.apache.org/repos/asf/cloudstack/blob/77d18cff/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java index 34b8f29..0f71c7b 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java @@ -16,11 +16,11 @@ // under the License. package com.cloud.hypervisor.xen.resource; +import org.apache.log4j.Logger; + import java.util.ArrayList; import java.util.HashMap; -import org.apache.log4j.Logger; - /** * Reduce bloat inside CitrixResourceBase * http://git-wip-us.apache.org/repos/asf/cloudstack/blob/77d18cff/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpServer16Resource.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpServer16Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpServer16Resource.java new file mode 100644 index 0000000..8cb7997 --- /dev/null +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpServer16Resource.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package com.cloud.hypervisor.xen.resource; + +public class XcpServer16Resource extends XcpServerResource { + + public XcpServer16Resource() { + super(); + } + + @Override + protected String getGuestOsType(String stdType, boolean bootFromCD) { + return CitrixHelper.getXcp160GuestOsType(stdType); + } +} http://git-wip-us.apache.org/repos/asf/cloudstack/blob/77d18cff/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpServerResource.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpServerResource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpServerResource.java index 954773c..77dcb8f 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpServerResource.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpServerResource.java @@ -67,11 +67,7 @@ public class XcpServerResource extends CitrixResourceBase { @Override protected String getGuestOsType(String stdType, boolean bootFromCD) { - if (getVersion() != null && getVersion().startsWith("1.6")) { - return CitrixHelper.getXcp160GuestOsType(stdType); - } else { - return CitrixHelper.getXcpGuestOsType(stdType); - } + return CitrixHelper.getXcpGuestOsType(stdType); } @Override @@ -104,17 +100,4 @@ public class XcpServerResource extends CitrixResourceBase { return new NetworkUsageAnswer(cmd, ex); } } - - /** - * Sets the product version of the xen cloud platform. - * Used to determine guestOS types supported on the hypervisor - * @param version 1.1, 1.0, 1.4, 1.6 etc - */ - public void setVersion(String version) { - this.version = version; - } - - public String getVersion() { - return this.version; - } }