DaanHoogland commented on code in PR #10282:
URL: https://github.com/apache/cloudstack/pull/10282#discussion_r2367317545


##########
core/src/main/java/org/apache/cloudstack/storage/to/VolumeObjectTO.java:
##########
@@ -343,6 +344,10 @@ public void setDeviceId(Long deviceId) {
     }
 
     public void setCacheMode(DiskCacheMode cacheMode) {
+        if (DiskCacheMode.HYPERVISOR_DEFAULT.equals(cacheMode) && 
!Hypervisor.HypervisorType.KVM.equals(hypervisorType)) {
+            this.cacheMode = DiskOffering.DiskCacheMode.NONE;

Review Comment:
   yes, but also make clear these are the same enum/value and not accidentally 
similar named values from different locations. I.e. remove the `DiskOffering` 
bit:
   ```suggestion
           if (DiskCacheMode.HYPERVISOR_DEFAULT.equals(cacheMode) && 
!Hypervisor.HypervisorType.KVM.equals(hypervisorType)) {
               this.cacheMode = DiskCacheMode.NONE;
   ```



-- 
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