Skip to content

Commit d013c2f

Browse files
committed
address review comments
1 parent 26ed64f commit d013c2f

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,12 @@ public Answer execute(RestoreBackupCommand command, LibvirtComputingResource ser
7575
restoreVolumesOfDestroyedVMs(volumePaths, vmName, backupPath, backupRepoType, backupRepoAddress, mountOptions);
7676
}
7777
} catch (CloudRuntimeException e) {
78-
logger.error("Failed to restore backup for VM: " + vmName, e);
79-
return new BackupAnswer(command, false, e.getMessage());
78+
String errorMessage = "Failed to restore backup for VM: " + vmName + ".";
79+
if (e.getMessage() != null && !e.getMessage().isEmpty()) {
80+
errorMessage += " Details: " + e.getMessage();
81+
}
82+
logger.error(errorMessage);
83+
return new BackupAnswer(command, false, errorMessage);
8084
}
8185

8286
return new BackupAnswer(command, true, newVolumeId);

server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ public boolean deleteBackupOffering(final Long offeringId) {
278278

279279
public static String createVolumeInfoFromVolumes(List<VolumeVO> vmVolumes) {
280280
List<Backup.VolumeInfo> list = new ArrayList<>();
281-
vmVolumes.sort(Comparator.comparing(Volume::getDeviceId));
282-
for (Volume vol : vmVolumes) {
281+
vmVolumes.sort(Comparator.comparing(VolumeVO::getDeviceId));
282+
for (VolumeVO vol : vmVolumes) {
283283
list.add(new Backup.VolumeInfo(vol.getUuid(), vol.getPath(), vol.getVolumeType(), vol.getSize()));
284284
}
285285
return new Gson().toJson(list.toArray(), Backup.VolumeInfo[].class);

0 commit comments

Comments
 (0)