Fix convert command's timeout for snapshot commands (#13210)

This commit is contained in:
Erik Böck 2026-06-01 10:29:33 -03:00 committed by GitHub
parent 357186d64d
commit a3970bb153
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -2061,7 +2061,7 @@ public class KVMStorageProcessor implements StorageProcessor {
QemuImgFile destFile = new QemuImgFile(snapshotPath);
destFile.setFormat(PhysicalDiskFormat.QCOW2);
QemuImg q = new QemuImg(wait);
QemuImg q = new QemuImg(wait * 1000L);
q.convert(srcFile, destFile, options, qemuObjects, qemuImageOpts, null, true);
}

View File

@ -55,7 +55,7 @@ public class QemuImg {
/* The qemu-img binary. We expect this to be in $PATH */
public String _qemuImgPath = "qemu-img";
private String cloudQemuImgPath = "cloud-qemu-img";
private int timeout;
private long timeout;
private boolean skipZero = false;
private boolean noCache = false;
private long version;
@ -118,7 +118,7 @@ public class QemuImg {
* @param skipZeroIfSupported Don't write zeroes to target device during convert, if supported by qemu-img
* @param noCache Ensure we flush writes to target disk (useful for block device targets)
*/
public QemuImg(final int timeout, final boolean skipZeroIfSupported, final boolean noCache) throws LibvirtException {
public QemuImg(final long timeout, final boolean skipZeroIfSupported, final boolean noCache) throws LibvirtException {
if (skipZeroIfSupported) {
final Script s = new Script(_qemuImgPath, timeout);
s.add("--help");
@ -148,7 +148,7 @@ public class QemuImg {
* @param timeout
* The timeout of scripts executed by this QemuImg object.
*/
public QemuImg(final int timeout) throws LibvirtException, QemuImgException {
public QemuImg(final long timeout) throws LibvirtException, QemuImgException {
this(timeout, false, false);
}