joseflauzino commented on code in PR #6358:
URL: https://github.com/apache/cloudstack/pull/6358#discussion_r1012413128
##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java:
##########
@@ -275,7 +280,14 @@ public String toString() {
response.append(String.format("<cpu> <numa> <cell id='0'
cpus='0-%s' memory='%s' unit='KiB'/> </numa> </cpu>\n", this.maxVcpu - 1,
this.currentMemory));
}
- response.append(String.format("<devices>\n<memballoon
model='%s'/>\n</devices>\n", this.memoryBalloning ? "virtio" : "none"));
+ MemBalloonDef memBalloonDef = new MemBalloonDef();
+ if (this.memoryBalloning) {
+
memBalloonDef.defVirtioMemBalloon(String.valueOf(memoryBalloonStatsPeriod));
+ } else {
+ memBalloonDef.defNoneMemBalloon();
+ }
+ response.append(String.format("<devices>\n%s\n</devices>\n",
memBalloonDef.toString()));
+
Review Comment:
I think there is no need in this case. I've only added a condition before
appending the string. I also created a test case that validates this.
--
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]