mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
LibvirtComputingResource: Fix coverity scan, recent bugfixes revealed a potential unhandled null in getResizeScriptType
Change-Id: I5715a4424646261f2c43cd5e0a16fd72dd12c753
This commit is contained in:
parent
09e26c826f
commit
77d11eb1a3
@ -1840,7 +1840,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
|
|||||||
&& volFormat == PhysicalDiskFormat.QCOW2 ) {
|
&& volFormat == PhysicalDiskFormat.QCOW2 ) {
|
||||||
return "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
|
/* uses a local script now, eventually support for virStorageVolResize() will maybe work on
|
||||||
@ -1867,9 +1867,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
|
|||||||
String type = getResizeScriptType(pool, vol);
|
String type = getResizeScriptType(pool, vol);
|
||||||
|
|
||||||
if (pool.getType() != StoragePoolType.RBD) {
|
if (pool.getType() != StoragePoolType.RBD) {
|
||||||
if (type == null) {
|
if (type.equals("QCOW2") && shrinkOk) {
|
||||||
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);
|
return new ResizeVolumeAnswer(cmd, false, "Unable to shrink volumes of type " + type);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user