nvazquez commented on code in PR #6909:
URL: https://github.com/apache/cloudstack/pull/6909#discussion_r1073592017


##########
api/src/main/java/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java:
##########
@@ -319,6 +326,14 @@ public Map<String, String> getDetails() {
             customparameterMap.put("rootdisksize", rootdisksize.toString());
         }
 
+        if (getIoDriverPolicy() != null) {
+            customparameterMap.put(VmDetailConstants.IO_POLICY, 
getIoDriverPolicy().toString());
+        }
+
+        if (iothreadsEnabled != null && iothreadsEnabled) {

Review Comment:
   Can replace for BooleanUtils.toBoolean() ?



##########
api/src/main/java/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java:
##########
@@ -319,6 +326,14 @@ public Map<String, String> getDetails() {
             customparameterMap.put("rootdisksize", rootdisksize.toString());
         }
 
+        if (getIoDriverPolicy() != null) {
+            customparameterMap.put(VmDetailConstants.IO_POLICY, 
getIoDriverPolicy().toString());

Review Comment:
   Just a small refactor, can we invoke getIoDriverPolicy() once before the if 
block and use the value here so we don't have to invoke it again?



##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java:
##########
@@ -3055,24 +3073,34 @@ protected String getIoUringCheckCommand() {
      * (i) Qemu >= 5.0;
      * (ii) Libvirt >= 6.3.0
      */
-    protected void setDiskIoDriver(DiskDef disk) {
-        if (enableIoUring) {
-            disk.setIoDriver(DiskDef.IoDriver.IOURING);
+    public void setDiskIoDriver(DiskDef disk, IoDriverPolicy ioDriver) {
+        s_logger.debug(String.format("Disk IO driver policy [%s]. The host 
supports the io_uring policy [%s]", ioDriver, enableIoUring));
+        if (ioDriver != null) {
+            if (IoDriverPolicy.IOURING != ioDriver) {

Review Comment:
   Can we collapse this if block into one line?



##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java:
##########
@@ -1063,8 +1064,7 @@ public boolean configure(final String name, final 
Map<String, Object> params) th
         }
 
         // Enable/disable IO driver for Qemu (in case it is not set CloudStack 
can also detect if its supported by qemu)
-        Boolean enableIoUringConfig = 
AgentPropertiesFileHandler.getPropertyValue(AgentProperties.ENABLE_IO_URING);

Review Comment:
   If this property is being deprecated, can we remove it from agent.properties 
as well?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to