Skip to content

Commit 1cc9e27

Browse files
addressed review comments
1 parent 792b80f commit 1cc9e27

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
@@ -384,12 +384,13 @@ public Pair<Boolean, String> restoreBackedUpVolume(Backup backup, Backup.VolumeI
384384
restoredVolume.setPoolType(pool.getPoolType());
385385
restoredVolume.setPath(restoredVolume.getUuid());
386386
restoredVolume.setState(Volume.State.Copying);
387-
restoredVolume.setFormat(Storage.ImageFormat.QCOW2);
388-
if (pool.getPoolType() == Storage.StoragePoolType.RBD) {
389-
restoredVolume.setFormat(Storage.ImageFormat.RAW);
390-
}
391387
restoredVolume.setSize(backupVolumeInfo.getSize());
392388
restoredVolume.setDiskOfferingId(diskOffering.getId());
389+
if (pool.getPoolType() != Storage.StoragePoolType.RBD) {
390+
restoredVolume.setFormat(Storage.ImageFormat.QCOW2);
391+
} else {
392+
restoredVolume.setFormat(Storage.ImageFormat.RAW);
393+
}
393394

394395
RestoreBackupCommand restoreCommand = new RestoreBackupCommand();
395396
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
@@ -257,11 +257,11 @@ private boolean replaceRbdVolumeWithBackup(KVMStoragePoolManager storagePoolMgr,
257257
qemu = new QemuImg(timeout * 1000, true, false);
258258
if (!createTargetVolume) {
259259
KVMPhysicalDisk rdbDisk = volumeStoragePool.getPhysicalDisk(volumePath);
260-
logger.debug("RBD volume: {}", rdbDisk.toString());
260+
logger.debug("Restoring RBD volume: {}", rdbDisk.toString());
261261
qemu.setSkipTargetVolumeCreation(true);
262262
}
263263
} catch (LibvirtException ex) {
264-
throw new CloudRuntimeException("Failed to create qemu-img command to replace RBD volume with backup", ex);
264+
throw new CloudRuntimeException("Failed to create qemu-img command to restore RBD volume with backup", ex);
265265
}
266266

267267
QemuImgFile srcBackupFile = null;

0 commit comments

Comments
 (0)