CLOUDSTACK-6225: Check libvirt version and volume format before

adding flag VIR_STORAGE_VOL_RESIZE_ALLOCATE to resize volume
libvirt call
This commit is contained in:
Marcus Sorensen 2014-03-11 11:13:12 -06:00
parent 991e1eb6b1
commit c874e20c24

View File

@ -1804,8 +1804,11 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
try {
Connect conn = LibvirtConnection.getConnection();
StorageVol v = conn.storageVolLookupByPath(path);
int flags = 0;
int flags = 1;
if (conn.getLibVirVersion() > 1001000 && vol.getFormat() == PhysicalDiskFormat.RAW) {
flags = 1;
}
if (shrinkOk) {
flags = 4;
}