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 B67DB18F90 for ; Sat, 12 Dec 2015 12:59:25 +0000 (UTC) Received: (qmail 10848 invoked by uid 500); 12 Dec 2015 12:59:25 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 10611 invoked by uid 500); 12 Dec 2015 12:59:25 -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 10595 invoked by uid 99); 12 Dec 2015 12:59:25 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Dec 2015 12:59:25 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 34776E00A7; Sat, 12 Dec 2015 12:59:25 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: remi@apache.org To: commits@cloudstack.apache.org Date: Sat, 12 Dec 2015 12:59:25 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/2] git commit: updated refs/heads/4.6 to 65bf2ed Repository: cloudstack Updated Branches: refs/heads/4.6 61ebb53e1 -> 65bf2edfa CLOUDSTACK-9113: skip vm with inconsistent state when getVmStats/getVmDiskStats Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/24edf1c1 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/24edf1c1 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/24edf1c1 Branch: refs/heads/4.6 Commit: 24edf1c1e4892b2f34b334b6e6fa13364bc413e2 Parents: 9ce1334 Author: Wei Zhou Authored: Mon Dec 7 12:02:43 2015 +0100 Committer: Wei Zhou Committed: Mon Dec 7 12:15:24 2015 +0100 ---------------------------------------------------------------------- .../LibvirtGetVmDiskStatsCommandWrapper.java | 16 ++++++++++------ .../wrapper/LibvirtGetVmStatsCommandWrapper.java | 14 +++++++++----- 2 files changed, 19 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/24edf1c1/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVmDiskStatsCommandWrapper.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVmDiskStatsCommandWrapper.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVmDiskStatsCommandWrapper.java index 52449e9..6316be9 100644 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVmDiskStatsCommandWrapper.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVmDiskStatsCommandWrapper.java @@ -48,12 +48,16 @@ public final class LibvirtGetVmDiskStatsCommandWrapper extends CommandWrapper> vmDiskStatsNameMap = new HashMap>(); final Connect conn = libvirtUtilitiesHelper.getConnection(); for (final String vmName : vmNames) { - final List statEntry = libvirtComputingResource.getVmDiskStat(conn, vmName); - if (statEntry == null) { - continue; - } + try { + final List statEntry = libvirtComputingResource.getVmDiskStat(conn, vmName); + if (statEntry == null) { + continue; + } - vmDiskStatsNameMap.put(vmName, statEntry); + vmDiskStatsNameMap.put(vmName, statEntry); + } catch (LibvirtException e) { + s_logger.warn("Can't get vm disk stats: " + e.toString() + ", continue"); + } } return new GetVmDiskStatsAnswer(command, "", command.getHostName(), vmDiskStatsNameMap); } catch (final LibvirtException e) { @@ -61,4 +65,4 @@ public final class LibvirtGetVmDiskStatsCommandWrapper extends CommandWrapper