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 E0DAAF63E for ; Wed, 29 May 2013 09:54:09 +0000 (UTC) Received: (qmail 11181 invoked by uid 500); 29 May 2013 09:54:07 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 11046 invoked by uid 500); 29 May 2013 09:54:06 -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 10526 invoked by uid 99); 29 May 2013 09:54:03 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 May 2013 09:54:03 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id C5B5289CA19; Wed, 29 May 2013 09:54:02 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sateesh@apache.org To: commits@cloudstack.apache.org Date: Wed, 29 May 2013 09:54:04 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [03/50] git commit: updated refs/heads/vmware-storage-motion to 004e74d agent: Only probe running VMs for the current Hypervisor Type Otherwise we try to probe for LXC VMs on a KVM hypervisor and vise versa. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/322db71e Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/322db71e Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/322db71e Branch: refs/heads/vmware-storage-motion Commit: 322db71eedb6b52fca6f92b46b613607083c4d88 Parents: 5b902c7 Author: Wido den Hollander Authored: Sun May 26 11:38:00 2013 +0200 Committer: Wido den Hollander Committed: Sun May 26 11:38:41 2013 +0200 ---------------------------------------------------------------------- agent/conf/agent.properties | 5 +++ .../kvm/resource/LibvirtComputingResource.java | 24 ++++++++------ 2 files changed, 19 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/322db71e/agent/conf/agent.properties ---------------------------------------------------------------------- diff --git a/agent/conf/agent.properties b/agent/conf/agent.properties index 7dc4ba8..60030ae 100644 --- a/agent/conf/agent.properties +++ b/agent/conf/agent.properties @@ -84,6 +84,11 @@ domr.scripts.dir=scripts/network/domr/kvm # set the hypervisor type, values are: kvm, lxc # hypervisor.type=kvm +# set the hypervisor URI. Usually there is no need for changing this +# For KVM: qemu:///system +# For LXC: lxc:/// +# hypervisor.uri=qemu:///system + # settings to enable direct networking in libvirt, should not be used # on hosts that run system vms, values for mode are: private, bridge, vepa # libvirt.vif.driver=com.cloud.hypervisor.kvm.resource.DirectVifDriver http://git-wip-us.apache.org/repos/asf/cloudstack/blob/322db71e/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java index c34d1eb..f979cfe 100755 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java @@ -3943,18 +3943,22 @@ ServerResource { final HashMap vmStates = new HashMap(); Connect conn = null; - try { - conn = LibvirtConnection.getConnectionByType(HypervisorType.LXC.toString()); - vmStates.putAll(getAllVms(conn)); - } catch (LibvirtException e) { - s_logger.debug("Failed to get connection: " + e.getMessage()); + if (_hypervisorType == HypervisorType.LXC) { + try { + conn = LibvirtConnection.getConnectionByType(HypervisorType.LXC.toString()); + vmStates.putAll(getAllVms(conn)); + } catch (LibvirtException e) { + s_logger.debug("Failed to get connection: " + e.getMessage()); + } } - try { - conn = LibvirtConnection.getConnectionByType(HypervisorType.KVM.toString()); - vmStates.putAll(getAllVms(conn)); - } catch (LibvirtException e) { - s_logger.debug("Failed to get connection: " + e.getMessage()); + if (_hypervisorType == HypervisorType.KVM) { + try { + conn = LibvirtConnection.getConnectionByType(HypervisorType.KVM.toString()); + vmStates.putAll(getAllVms(conn)); + } catch (LibvirtException e) { + s_logger.debug("Failed to get connection: " + e.getMessage()); + } } return vmStates;