You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2019/01/22 12:07:23 UTC

[GitHub] DaanHoogland commented on a change in pull request #3133: feature: add libvirt / qemu io bursting

DaanHoogland commented on a change in pull request #3133: feature: add libvirt / qemu io bursting
URL: https://github.com/apache/cloudstack/pull/3133#discussion_r249753134
 
 

 ##########
 File path: plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
 ##########
 @@ -891,6 +931,31 @@ public String toString() {
                     diskBuilder.append("<read_iops_sec>" + _iopsReadRate + "</read_iops_sec>\n");
                 if ((_iopsWriteRate != null) && (_iopsWriteRate > 0))
                     diskBuilder.append("<write_iops_sec>" + _iopsWriteRate + "</write_iops_sec>\n");
+                if (s_qemuVersion >= 2004000) {
+                    if (_bytesReadRateMax != null && _bytesReadRateMax > 0 ) {
+                        diskBuilder.append("<read_bytes_sec_max>" + _bytesReadRateMax + "</read_bytes_sec_max>\n");
+                    }
+                    if (_bytesWriteRateMax != null && _bytesWriteRateMax > 0) {
+                        diskBuilder.append("<write_bytes_sec_max>" + _bytesWriteRateMax + "</write_bytes_sec_max>\n");
+                    }
+                    if (_iopsReadRateMax != null && _iopsReadRateMax > 0)
+                        diskBuilder.append("<read_iops_sec_max>" + _iopsReadRateMax + "</read_iops_sec_max>\n");
+                    if (_iopsWriteRateMax != null && _iopsWriteRateMax > 0)
+                        diskBuilder.append("<write_iops_sec_max>" + _iopsWriteRateMax + "</write_iops_sec_max>\n");
+                }
+                if (s_qemuVersion >= 2006000) {
 
 Review comment:
   I like, however/and; It might be wise not to check on the number here but asses whether the feature is supported as more then once features have been added and disappeared for security reasons from smantically newer/older versions. I suggest a versionsSupports<Feature>(version) set of functions to be called in this kind of conditionals. i.e.
   versionSupportsBursts(version) and do the switch/regexp/simple conditional in it.
   Most of the times a simple > minimal version will work but in libvirt, or in for instance bouncy castle that is not always true.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services