GabrielBrascher commented on a change in pull request #3133: feature: add
libvirt / qemu io bursting
URL: https://github.com/apache/cloudstack/pull/3133#discussion_r250628726
##########
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:
@DaanHoogland suggestion looks great, a nice way of managing different
versions and their supported actions. I am +1 on creating such method.
Another approach that also helps (less elaborated than the method approach)
is extracting the version value to a variable with a suggestive name and a
Javadoc documenting the version :wink:
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services