Skip to content

Commit 6dce08a

Browse files
weizhouapacheJoaoJandre
authored andcommitted
kvm: fix vm deployment from RAW template (apache#10880)
* kvm: fix vm deployment from RAW template * Update plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java Co-authored-by: João Jandre <48719461+JoaoJandre@users.noreply.github.com> --------- Co-authored-by: João Jandre <48719461+JoaoJandre@users.noreply.github.com>
1 parent 6cabd53 commit 6dce08a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1670,7 +1670,9 @@ to support snapshots(backuped) as qcow2 files. */
16701670
} else {
16711671
destFile = new QemuImgFile(destPath, destFormat);
16721672
try {
1673-
qemu.convert(srcFile, destFile, null, null, new QemuImageOptions(srcFile.getFormat(), srcFile.getFileName(), null), null, false, true);
1673+
boolean isQCOW2 = PhysicalDiskFormat.QCOW2.equals(sourceFormat);
1674+
qemu.convert(srcFile, destFile, null, null, new QemuImageOptions(srcFile.getFormat(), srcFile.getFileName(), null),
1675+
null, false, isQCOW2);
16741676
Map<String, String> destInfo = qemu.info(destFile);
16751677
Long virtualSize = Long.parseLong(destInfo.get(QemuImg.VIRTUAL_SIZE));
16761678
newDisk.setVirtualSize(virtualSize);

0 commit comments

Comments
 (0)