Skip to content

Commit 8113584

Browse files
addressed review comments
1 parent 93108c3 commit 8113584

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

plugins/backup/nas/src/main/java/org/apache/cloudstack/backup/NASBackupProvider.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,12 +359,13 @@ public Pair<Boolean, String> restoreBackedUpVolume(Backup backup, Backup.VolumeI
359359
restoredVolume.setPoolType(pool.getPoolType());
360360
restoredVolume.setPath(restoredVolume.getUuid());
361361
restoredVolume.setState(Volume.State.Copying);
362-
restoredVolume.setFormat(Storage.ImageFormat.QCOW2);
363-
if (pool.getPoolType() == Storage.StoragePoolType.RBD) {
364-
restoredVolume.setFormat(Storage.ImageFormat.RAW);
365-
}
366362
restoredVolume.setSize(backupVolumeInfo.getSize());
367363
restoredVolume.setDiskOfferingId(diskOffering.getId());
364+
if (pool.getPoolType() != Storage.StoragePoolType.RBD) {
365+
restoredVolume.setFormat(Storage.ImageFormat.QCOW2);
366+
} else {
367+
restoredVolume.setFormat(Storage.ImageFormat.RAW);
368+
}
368369

369370
RestoreBackupCommand restoreCommand = new RestoreBackupCommand();
370371
restoreCommand.setBackupPath(backup.getExternalId());

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,11 @@ private boolean replaceRbdVolumeWithBackup(KVMStoragePoolManager storagePoolMgr,
233233
qemu = new QemuImg(timeout * 1000, true, false);
234234
if (!createTargetVolume) {
235235
KVMPhysicalDisk rdbDisk = volumeStoragePool.getPhysicalDisk(volumePath);
236-
logger.debug("RBD volume: {}", rdbDisk.toString());
236+
logger.debug("Restoring RBD volume: {}", rdbDisk.toString());
237237
qemu.setSkipTargetVolumeCreation(true);
238238
}
239239
} catch (LibvirtException ex) {
240-
throw new CloudRuntimeException("Failed to create qemu-img command to replace RBD volume with backup", ex);
240+
throw new CloudRuntimeException("Failed to create qemu-img command to restore RBD volume with backup", ex);
241241
}
242242

243243
QemuImgFile srcBackupFile = null;

0 commit comments

Comments
 (0)