From 3535f88d16fe3a10f2d4fb4aa4e5b542c7c835ba Mon Sep 17 00:00:00 2001 From: Marcus Sorensen Date: Tue, 5 Feb 2013 12:39:36 -0700 Subject: [PATCH] Summary: Disallow shrinking volume type QCOW2 to fail with better message Signed-off-by: Marcus Sorensen 1360093176 -0700 --- .../cloud/hypervisor/kvm/resource/LibvirtComputingResource.java | 2 ++ 1 file changed, 2 insertions(+) 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 d3a4a229b49..88c3aff6fab 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 @@ -1429,6 +1429,8 @@ ServerResource { 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) { + return new ResizeVolumeAnswer(cmd, false, "Unable to shrink volumes of type " + type); } s_logger.debug("got to the stage where we execute the volume resize, params:"