Skip to content

Commit 6fc806e

Browse files
committed
KVM: fix more issues of qcow2 format on CLVM
1 parent edc34d9 commit 6fc806e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3641,6 +3641,9 @@ public int compare(final DiskTO arg0, final DiskTO arg1) {
36413641
if (pool.getType() == StoragePoolType.Linstor && isQemuDiscardBugFree(diskBusType)) {
36423642
disk.setDiscard(DiscardType.UNMAP);
36433643
}
3644+
if (pool.getType() == StoragePoolType.CLVM) {
3645+
disk.setDiskFormatType(DiskDef.DiskFmtType.QCOW2);
3646+
}
36443647
} else {
36453648
if (volume.getType() == Volume.Type.DATADISK && !(isWindowsTemplate && isUefiEnabled)) {
36463649
disk.defFileBasedDisk(physicalDisk.getPath(), devId, diskBusTypeData, DiskDef.DiskFmtType.QCOW2);
@@ -3995,7 +3998,7 @@ public synchronized String attachOrDetachDisk(final Connect conn,
39953998
if (attachingPool.getType() == StoragePoolType.RBD) {
39963999
diskdef.defNetworkBasedDisk(attachingDisk.getPath(), attachingPool.getSourceHost(), attachingPool.getSourcePort(), attachingPool.getAuthUserName(),
39974000
attachingPool.getUuid(), devId, busT, DiskProtocol.RBD, DiskDef.DiskFmtType.RAW);
3998-
} else if (attachingPool.getType() == StoragePoolType.PowerFlex) {
4001+
} else if (attachingPool.getType() == StoragePoolType.PowerFlex || attachingPool.getType() == StoragePoolType.CLVM) {
39994002
diskdef.defBlockBasedDisk(attachingDisk.getPath(), devId, busT);
40004003
} else if (attachingPool.getType() == StoragePoolType.Gluster) {
40014004
diskdef.defNetworkBasedDisk(attachingDisk.getPath(), attachingPool.getSourceHost(), attachingPool.getSourcePort(), null,

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1514,7 +1514,7 @@ protected synchronized void attachOrDetachDisk(final Connect conn, final boolean
15141514
final String glusterVolume = attachingPool.getSourceDir().replace("/", "");
15151515
diskdef.defNetworkBasedDisk(glusterVolume + path.replace(mountpoint, ""), attachingPool.getSourceHost(), attachingPool.getSourcePort(), null,
15161516
null, devId, busT, DiskProtocol.GLUSTER, DiskDef.DiskFmtType.QCOW2);
1517-
} else if (attachingPool.getType() == StoragePoolType.PowerFlex) {
1517+
} else if (attachingPool.getType() == StoragePoolType.PowerFlex || attachingPool.getType() == StoragePoolType.CLVM) {
15181518
diskdef.defBlockBasedDisk(attachingDisk.getPath(), devId, busT);
15191519
if (attachingDisk.getFormat() == PhysicalDiskFormat.QCOW2) {
15201520
diskdef.setDiskFormatType(DiskDef.DiskFmtType.QCOW2);

0 commit comments

Comments
 (0)