Skip to content

Commit 42780e7

Browse files
author
Glover, Rene (rg9975)
committed
address PR comments from @sureshanaparti
1 parent 51a90dc commit 42780e7

File tree

3 files changed

+8
-19
lines changed

3 files changed

+8
-19
lines changed

engine/storage/datamotion/src/main/java/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -931,18 +931,18 @@ private HostVO getHostOnWhichToExecuteMigrationCommand(VolumeInfo srcVolumeInfo,
931931

932932
private VolumeInfo createTemporaryVolumeCopyOfSnapshotAdaptive(SnapshotInfo snapshotInfo) {
933933
VolumeInfo tempVolumeInfo = null;
934-
VolumeVO volumeVO = null;
934+
VolumeVO tempVolumeVO = null;
935935
try {
936-
volumeVO = new VolumeVO(Volume.Type.DATADISK, snapshotInfo.getName() + "_" + System.currentTimeMillis() + ".TMP",
936+
tempVolumeVO = new VolumeVO(Volume.Type.DATADISK, snapshotInfo.getName() + "_" + System.currentTimeMillis() + ".TMP",
937937
snapshotInfo.getDataCenterId(), snapshotInfo.getDomainId(), snapshotInfo.getAccountId(), 0, ProvisioningType.THIN, snapshotInfo.getSize(), 0L, 0L, "");
938-
volumeVO.setPoolId(snapshotInfo.getDataStore().getId());
939-
_volumeDao.persist(volumeVO);
940-
tempVolumeInfo = this._volFactory.getVolume(volumeVO.getId());
938+
tempVolumeVO.setPoolId(snapshotInfo.getDataStore().getId());
939+
_volumeDao.persist(tempVolumeVO);
940+
tempVolumeInfo = this._volFactory.getVolume(tempVolumeVO.getId());
941941

942942
if (snapshotInfo.getDataStore().getDriver().canCopy(snapshotInfo, tempVolumeInfo)) {
943943
snapshotInfo.getDataStore().getDriver().copyAsync(snapshotInfo, tempVolumeInfo, null, null);
944944
// refresh volume info as data could have changed
945-
tempVolumeInfo = this._volFactory.getVolume(volumeVO.getId());
945+
tempVolumeInfo = this._volFactory.getVolume(tempVolumeVO.getId());
946946
} else {
947947
throw new CloudRuntimeException("Storage driver indicated it could create a volume from the snapshot but rejected the subsequent request to do so");
948948
}
@@ -954,8 +954,8 @@ private VolumeInfo createTemporaryVolumeCopyOfSnapshotAdaptive(SnapshotInfo snap
954954
}
955955

956956
// cleanup temporary volume
957-
if (volumeVO != null) {
958-
_volumeDao.remove(volumeVO.getId());
957+
if (tempVolumeVO != null) {
958+
_volumeDao.remove(tempVolumeVO.getId());
959959
}
960960
} catch (Throwable e2) {
961961
LOGGER.warn("Failed to delete temporary volume created for copy", e2);

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ public FiberChannelAdapter() {
4141
if (hostname.indexOf(".") > 0) {
4242
hostname = hostname.substring(0, hostname.indexOf(".")); // strip off domain
4343
}
44-
if (hostname.indexOf(".") > 0) {
45-
hostname = hostname.substring(0, hostname.indexOf(".")); // strip off domain
46-
}
4744
hostnameFq = inetAddress.getCanonicalHostName(); // fully qualified hostname
4845
LOGGER.info("Loaded FiberChannelAdapter for StorageLayer on host [" + hostname + "]");
4946
} catch (UnknownHostException e) {

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -364,14 +364,6 @@ public KVMPhysicalDisk copyPhysicalDisk(KVMPhysicalDisk disk, String name, KVMSt
364364
LOGGER.debug("Starting COPY from source path " + srcFile.getFileName() + " to target volume path: " + destDisk.getPath());
365365

366366
ScriptResult result = runScript(copyScript, timeout, destDisk.getFormat().toString().toLowerCase(), srcFile.getFileName(), destFile.getFileName());
367-
/**Script script = new Script(
368-
String.format("%s %s %s %s", copyScript, destDisk.getFormat().toString().toLowerCase(), srcFile.getFileName(), destFile.getFileName()),
369-
Duration.millis(timeout),
370-
LOGGER);
371-
372-
script.execute();
373-
int rc = script.getExitValue();
374-
*/
375367
int rc = result.getExitCode();
376368
if (rc != 0) {
377369
throw new CloudRuntimeException("Failed to convert from " + srcFile.getFileName() + " to " + destFile.getFileName() + " the error was: " + rc + " - " + result.getResult());

0 commit comments

Comments
 (0)