From 24edf1c1e4892b2f34b334b6e6fa13364bc413e2 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Mon, 7 Dec 2015 12:02:43 +0100 Subject: [PATCH 1/2] CLOUDSTACK-9113: skip vm with inconsistent state when getVmStats/getVmDiskStats --- .../LibvirtGetVmDiskStatsCommandWrapper.java | 16 ++++++++++------ .../wrapper/LibvirtGetVmStatsCommandWrapper.java | 14 +++++++++----- 2 files changed, 19 insertions(+), 11 deletions(-) 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 52449e93f6d..6316be9fbf3 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 Date: Sat, 12 Dec 2015 11:00:41 +0100 Subject: [PATCH 2/2] Show actual diff in commits after merge --- tools/git/git-fwd-merge | 5 +++++ tools/git/git-pr | 3 +++ 2 files changed, 8 insertions(+) diff --git a/tools/git/git-fwd-merge b/tools/git/git-fwd-merge index d0ce46a681a..44cbf0a69a0 100755 --- a/tools/git/git-fwd-merge +++ b/tools/git/git-fwd-merge @@ -52,5 +52,10 @@ fi # Clean up rm -fr ${tmpMessageFile} +apache_remote=$(git remote -v | grep -E "git-wip-us\.apache\.org" | head -n 1 | cut -f1) +echo "INFO: Actual diff in commits is: (running git log --pretty=oneline --abbrev-commit ${apache_remote}/${currentBranch}..${currentBranch})" +echo +git log --pretty=oneline --abbrev-commit ${apache_remote}/${currentBranch}..${currentBranch} + # What's next echo "We're done! Please double check using 'git log -p' and 'git push' when you're sure." diff --git a/tools/git/git-pr b/tools/git/git-pr index 2bd58f689eb..696e0ad1d23 100755 --- a/tools/git/git-pr +++ b/tools/git/git-pr @@ -179,6 +179,7 @@ elif [ "${prMergeableState}" != "clean" ] && [ ${force} -eq 1 ]; then fi github_remote=$(git remote -v | grep -E "apache/${repoName}(.git)?" | head -n 1 | cut -f1) +apache_remote=$(git remote -v | grep -E "git-wip-us\.apache\.org" | head -n 1 | cut -f1) if [ ${#github_remote} -eq 0 ]; then echo "ERROR: We couldn't find a git remote pointing to 'apache/${repoName}.git' to merge the PR from." echo "INFO: Currently, your configured remotes are:" @@ -230,6 +231,8 @@ fi echo "INFO: ***********************************************************************************" echo "INFO: Merged successfully! Please double check using 'git log -p' and 'git push' when you're sure." echo "INFO: About commits: there should be ${prCommits} from the PR plus 1 merge commit." +echo "INFO: Actual diff in commits is: (running git log --pretty=oneline --abbrev-commit ${apache_remote}/${currentBranch}..${currentBranch})" echo +git log --pretty=oneline --abbrev-commit ${apache_remote}/${currentBranch}..${currentBranch} clean_up_and_exit 0