Skip to content

Commit bb819b6

Browse files
committed
Add comment explaining a section
1 parent 1913e53 commit bb819b6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

plugins/hypervisors/vmware/src/main/java/com/cloud/storage/resource/VmwareStorageProcessor.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2101,6 +2101,14 @@ private Answer attachVolume(Command cmd, DiskTO disk, boolean isAttach, boolean
21012101
AttachAnswer answer = new AttachAnswer(disk);
21022102

21032103
if (isAttach) {
2104+
// Let's first find which disk controller should be used for the volume being attached.
2105+
//
2106+
// `controllerInfo` can not be null here. It is always defined when creating the `AttachComand` in
2107+
// `com.cloud.storage.VolumeApiServiceImpl#sendAttachVolumeCommand`.
2108+
//
2109+
// If `VmDetailConstants.ROOT_DISK_CONTROLLER` or `VmDetailConstants.DATA_DISK_CONTROLLER` are not present
2110+
// in `controllerInfo`, `com.cloud.hypervisor.vmware.util.VmwareHelper#getDiskControllersFromVmSettings`
2111+
// will return default values.
21042112
String rootDiskControllerDetail = controllerInfo.get(VmDetailConstants.ROOT_DISK_CONTROLLER);
21052113
String dataDiskControllerDetail = controllerInfo.get(VmDetailConstants.DATA_DISK_CONTROLLER);
21062114
Pair<DiskControllerMappingVO, DiskControllerMappingVO> specifiedDiskControllers = VmwareHelper.getDiskControllersFromVmSettings(rootDiskControllerDetail, dataDiskControllerDetail, false);

0 commit comments

Comments
 (0)