Skip to content

Commit 8e27a1a

Browse files
committed
check for version 5.1 and not 5.10
1 parent 41d920e commit 8e27a1a

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public Answer execute(CompressBackupCommand command, LibvirtComputingResource se
9999
return new Answer(command);
100100
}
101101
private Integer validateAndGetRateLimit(CompressBackupCommand command, QemuImg qemuImg) {
102-
if (qemuImg.getVersion() < QemuImg.QEMU_5_20) {
102+
if (qemuImg.getVersion() < QemuImg.QEMU_5_2) {
103103
throw new CloudRuntimeException("Qemu version is lower than 5.2.0, unable to set the rate limit.");
104104
}
105105
return command.getRateLimit() < 1 ? null : command.getRateLimit();
@@ -109,7 +109,7 @@ private Integer validateAndGetRateLimit(CompressBackupCommand command, QemuImg q
109109
* Sets the compression type option if qemu-img is at least in version 5.1. Otherwise, will not set it and qemu will use zlib.
110110
* */
111111
private void setCompressionTypeOptionIfAvailable(QemuImg qemuImg, HashMap<String, String> options, Backup.CompressionLibrary compressionLib) {
112-
if (qemuImg.getVersion() >= QemuImg.QEMU_5_10) {
112+
if (qemuImg.getVersion() >= QemuImg.QEMU_5_1) {
113113
options.put(COMPRESSION_TYPE, compressionLib.name());
114114
return;
115115
}

plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/utils/qemu/QemuImg.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ public class QemuImg {
5454
public static final String TARGET_ZERO_FLAG = "--target-is-zero";
5555
public static final String PREALLOCATION = "preallocation";
5656
public static final long QEMU_2_10 = 2010000;
57-
public static final long QEMU_5_10 = 5010000;
58-
public static final long QEMU_5_20 = 5020000;
57+
public static final long QEMU_5_1 = 5001000;
58+
public static final long QEMU_5_2 = 5002000;
5959

6060
public static final int MIN_BITMAP_VERSION = 3;
6161

@@ -520,7 +520,7 @@ public void convert(final QemuImgFile srcFile, final QemuImgFile destFile, QemuI
520520
script.add(srcFile.getFileName());
521521
}
522522

523-
if (this.version >= QEMU_5_10 && keepBitmaps && Qcow2Inspector.validateQcow2Version(srcFile.getFileName(), MIN_BITMAP_VERSION)) {
523+
if (this.version >= QEMU_5_1 && keepBitmaps && Qcow2Inspector.validateQcow2Version(srcFile.getFileName(), MIN_BITMAP_VERSION)) {
524524
script.add("--bitmaps");
525525
}
526526

0 commit comments

Comments
 (0)