Skip to content

Commit 4dce326

Browse files
JoaoJandreCopilot
andauthored
Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent aa35e57 commit 4dce326

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2093,7 +2093,7 @@ protected void rebaseSnapshot(SnapshotObjectTO snapshotObjectTO, KVMStoragePool
20932093
QemuImg qemuImg = new QemuImg(wait);
20942094
qemuImg.rebase(snapshotFile, parentSnapshotFile, PhysicalDiskFormat.QCOW2.toString(), false);
20952095
} catch (LibvirtException | QemuImgException e) {
2096-
if (!e.getMessage().contains("Is another process using the image")) {
2096+
if (!StringUtils.contains(e.getMessage(), "Is another process using the image")) {
20972097
logger.error("Exception while rebasing incremental snapshot [{}] due to: [{}].", snapshotName, e.getMessage(), e);
20982098
throw new CloudRuntimeException(e);
20992099
}
@@ -2109,7 +2109,9 @@ private void retryRebase(String snapshotName, int wait, Exception e, QemuImgFile
21092109
qemuImg.rebase(snapshotFile, parentSnapshotFile, PhysicalDiskFormat.QCOW2.toString(), false);
21102110
} catch (LibvirtException | QemuImgException | InterruptedException ex) {
21112111
logger.error("Unable to rebase snapshot [{}].", snapshotName, ex);
2112-
throw new CloudRuntimeException(e);
2112+
CloudRuntimeException cre = new CloudRuntimeException(ex);
2113+
cre.addSuppressed(e);
2114+
throw cre;
21132115
}
21142116
}
21152117

0 commit comments

Comments
 (0)