mirror of https://github.com/apache/cloudstack.git
LibvirtComputingResource: Fix coverity scan, recent bugfixes revealed a potential unhandled null in getResizeScriptType
Change-Id: I5715a4424646261f2c43cd5e0a16fd72dd12c753
This commit is contained in:
parent
b9e0e914c4
commit
344a9f992e
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue