Skip to content

Commit a3970bb

Browse files
authored
Fix convert command's timeout for snapshot commands (#13210)
1 parent 357186d commit a3970bb

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

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
@@ -2061,7 +2061,7 @@ private void convertTheBaseFileToSnapshot(KVMPhysicalDisk baseFile, String snaps
20612061
QemuImgFile destFile = new QemuImgFile(snapshotPath);
20622062
destFile.setFormat(PhysicalDiskFormat.QCOW2);
20632063

2064-
QemuImg q = new QemuImg(wait);
2064+
QemuImg q = new QemuImg(wait * 1000L);
20652065
q.convert(srcFile, destFile, options, qemuObjects, qemuImageOpts, null, true);
20662066
}
20672067

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
@@ -55,7 +55,7 @@ public class QemuImg {
5555
/* The qemu-img binary. We expect this to be in $PATH */
5656
public String _qemuImgPath = "qemu-img";
5757
private String cloudQemuImgPath = "cloud-qemu-img";
58-
private int timeout;
58+
private long timeout;
5959
private boolean skipZero = false;
6060
private boolean noCache = false;
6161
private long version;
@@ -118,7 +118,7 @@ public static PreallocationType getPreallocationType(final Storage.ProvisioningT
118118
* @param skipZeroIfSupported Don't write zeroes to target device during convert, if supported by qemu-img
119119
* @param noCache Ensure we flush writes to target disk (useful for block device targets)
120120
*/
121-
public QemuImg(final int timeout, final boolean skipZeroIfSupported, final boolean noCache) throws LibvirtException {
121+
public QemuImg(final long timeout, final boolean skipZeroIfSupported, final boolean noCache) throws LibvirtException {
122122
if (skipZeroIfSupported) {
123123
final Script s = new Script(_qemuImgPath, timeout);
124124
s.add("--help");
@@ -148,7 +148,7 @@ public QemuImg(final int timeout, final boolean skipZeroIfSupported, final boole
148148
* @param timeout
149149
* The timeout of scripts executed by this QemuImg object.
150150
*/
151-
public QemuImg(final int timeout) throws LibvirtException, QemuImgException {
151+
public QemuImg(final long timeout) throws LibvirtException, QemuImgException {
152152
this(timeout, false, false);
153153
}
154154

0 commit comments

Comments
 (0)