File tree Expand file tree Collapse file tree 4 files changed +9
-5
lines changed
plugins/hypervisors/kvm/src
main/java/com/cloud/hypervisor/kvm/resource
test/java/com/cloud/hypervisor/kvm/resource Expand file tree Collapse file tree 4 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -1340,7 +1340,11 @@ public String getMemBalloonStatsPeriod() {
13401340 @ Override
13411341 public String toString () {
13421342 StringBuilder memBalloonBuilder = new StringBuilder ();
1343- memBalloonBuilder .append ("<memballoon model='" + memBalloonModel + "'>\n " );
1343+ memBalloonBuilder .append ("<memballoon model='" + memBalloonModel + "'" );
1344+ if (memBalloonModel != MemBalloonModel .NONE ) {
1345+ memBalloonBuilder .append (" autodeflate='on' freePageReporting='on'" );
1346+ }
1347+ memBalloonBuilder .append (">\n " );
13441348 if (StringUtils .isNotBlank (memBalloonStatsPeriod )) {
13451349 memBalloonBuilder .append ("<stats period='" + memBalloonStatsPeriod +"'/>\n " );
13461350 }
Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ public void testDomainXMLParser() {
196196 "<alias name='video0'/>" +
197197 "<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>" +
198198 "</video>" +
199- "<memballoon model='virtio'>" +
199+ "<memballoon model='virtio' autodeflate='on' freePageReporting='on' >" +
200200 "<stats period='60'/>" +
201201 "<alias name='balloon0'/>" +
202202 "<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>" +
@@ -379,7 +379,7 @@ public void testDomainXMLParserWithoutModelName() {
379379 " <redirdev bus='usb' type='spicevmc'>\n " +
380380 " <address type='usb' bus='0' port='3'/>\n " +
381381 " </redirdev>\n " +
382- " <memballoon model='virtio'>\n " +
382+ " <memballoon model='virtio' autodeflate='on' freePageReporting='on' >\n " +
383383 " <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>\n " +
384384 " </memballoon>\n " +
385385 " </devices>\n " +
Original file line number Diff line number Diff line change @@ -465,7 +465,7 @@ public void memBalloonDefTestNone() {
465465
466466 @ Test
467467 public void memBalloonDefTestVirtio () {
468- String expectedXml = "<memballoon model='virtio'>\n <stats period='60'/>\n </memballoon>" ;
468+ String expectedXml = "<memballoon model='virtio' autodeflate='on' freePageReporting='on' >\n <stats period='60'/>\n </memballoon>" ;
469469 MemBalloonDef memBalloonDef = new MemBalloonDef ();
470470 memBalloonDef .defVirtioMemBalloon ("60" );
471471
Original file line number Diff line number Diff line change @@ -208,7 +208,7 @@ public class LibvirtMigrateVolumeCommandWrapperTest {
208208 " <alias name='watchdog0'/>\n " +
209209 " <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>\n " +
210210 " </watchdog>\n " +
211- " <memballoon model='virtio'>\n " +
211+ " <memballoon model='virtio' autodeflate='on' freePageReporting='on' >\n " +
212212 " <alias name='balloon0'/>\n " +
213213 " <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>\n " +
214214 " </memballoon>\n " +
You can’t perform that action at this time.
0 commit comments