weizhouapache commented on code in PR #9823:
URL: https://github.com/apache/cloudstack/pull/9823#discussion_r1819295232


##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java:
##########
@@ -2585,7 +2585,13 @@ protected DevicesDef createDevicesDef(VirtualMachineTO 
vmTO, GuestDef guest, int
             Map<String, String> details = vmTO.getDetails();
 
             boolean isIothreadsEnabled = details != null && 
details.containsKey(VmDetailConstants.IOTHREADS);
-            devices.addDevice(createSCSIDef(vcpus, isIothreadsEnabled));
+            int controllers = vmTO.getDisks().length / 7;
+            if (vmTO.getDisks().length % 7 != 0) {
+                controllers++;
+            }
+            for (int i = 0; i < controllers; i++) {
+                devices.addDevice(createSCSIDef((short)i, vcpus, 
isIothreadsEnabled));
+            }

Review Comment:
   created a method, thanks for review @DaanHoogland 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to