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 74F0D1034D for ; Tue, 24 Feb 2015 00:57:06 +0000 (UTC) Received: (qmail 89139 invoked by uid 500); 24 Feb 2015 00:57:06 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 89107 invoked by uid 500); 24 Feb 2015 00:57: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 89098 invoked by uid 99); 24 Feb 2015 00:57:06 -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; Tue, 24 Feb 2015 00:57:06 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 28A75E084F; Tue, 24 Feb 2015 00:57:06 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mlsorensen@apache.org To: commits@cloudstack.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/4.5 to 344a9f9 Date: Tue, 24 Feb 2015 00:57:06 +0000 (UTC) Repository: cloudstack Updated Branches: refs/heads/4.5 b9e0e914c -> 344a9f992 LibvirtComputingResource: Fix coverity scan, recent bugfixes revealed a potential unhandled null in getResizeScriptType Change-Id: I5715a4424646261f2c43cd5e0a16fd72dd12c753 Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/344a9f99 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/344a9f99 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/344a9f99 Branch: refs/heads/4.5 Commit: 344a9f992e3cf070cc7ace43409f7d7b5ee50f0e Parents: b9e0e91 Author: Marcus Sorensen Authored: Mon Feb 23 16:55:56 2015 -0800 Committer: Marcus Sorensen Committed: Mon Feb 23 16:56:54 2015 -0800 ---------------------------------------------------------------------- .../hypervisor/kvm/resource/LibvirtComputingResource.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/344a9f99/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 bf417f6..df272ee 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 @@ -1839,7 +1839,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv && volFormat == PhysicalDiskFormat.QCOW2 ) { return "QCOW2"; } - return null; + throw new CloudRuntimeException("Cannot determine resize type from pool type " + pool.getType()); } /* uses a local script now, eventually support for virStorageVolResize() will maybe work on @@ -1866,9 +1866,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv String type = getResizeScriptType(pool, vol); if (pool.getType() != StoragePoolType.RBD) { - if (type == null) { - return new ResizeVolumeAnswer(cmd, false, "Unsupported volume format: pool type '" + pool.getType() + "' and volume format '" + vol.getFormat() + "'"); - } else if (type.equals("QCOW2") && shrinkOk) { + if (type.equals("QCOW2") && shrinkOk) { return new ResizeVolumeAnswer(cmd, false, "Unable to shrink volumes of type " + type); } } else {