Change in vdsm[master]: [WIP] Add balloon_min to VM.getVmBalloonInfo

msivak at redhat.com msivak at redhat.com
Mon Jun 17 12:59:26 UTC 2013


Martin Sivák has uploaded a new change for review.

Change subject: [WIP] Add balloon_min to VM.getVmBalloonInfo
......................................................................

[WIP] Add balloon_min to VM.getVmBalloonInfo

The balloon_min key will take it's value from memGuaranteedSize
attribute. It's default value will be 0, but can be overriden by
whoever is creating the VM instance or setting the attributes.

This functionality is needed for basic memory QoS.

Change-Id: I4fca97bf0d3621883d1320673c648d0fbbd50340
Signed-off-by: Martin Sivak <msivak at redhat.com>
---
M vdsm/vm.py
1 file changed, 17 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/99/15799/1

diff --git a/vdsm/vm.py b/vdsm/vm.py
index e8118a3..e131179 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -863,6 +863,11 @@
             <vcpu>smp</vcpu>
             <devices>
             </devices>
+            <metadata>
+                <ovirt>
+                    <guaranteedmemory>0</guaranteedmemory>
+                </ovirt>
+            </metadata>
         </domain>
 
         """
@@ -883,6 +888,15 @@
         self.dom.appendChildWithArgs('memory', text=memSizeKB)
         self.dom.appendChildWithArgs('currentMemory', text=memSizeKB)
         self.dom.appendChildWithArgs('vcpu', text=self.conf['smp'])
+
+        metadata = XMLElement('metadata')
+        self.dom.appendChild(metadata)
+
+        ovirt = XMLElement('ovirt')
+        metadata.appendChild(ovirt)
+
+        memSizeGuaranteedKB = str(int(self.conf.get('memGuaranteedSize', '0')) * 1024)
+        ovirt.appendChildWithArgs('guaranteedmemory', text=memSizeGuaranteedKB)
 
         self._devices = XMLElement('devices')
         self.dom.appendChild(self._devices)
@@ -4033,8 +4047,10 @@
             if dev['type'] == BALLOON_DEVICES and \
                     dev['specParams']['model'] != 'none':
                 max_mem = int(self.conf.get('memSize')) * 1024
+                min_mem = int(self.conf.get('memGuaranteedSize', '0')) * 1024
                 cur_mem = dev.get('target', max_mem)
-                return {'balloon_max': max_mem, 'balloon_cur': cur_mem}
+                return {'balloon_max': max_mem, 'balloon_cur': cur_mem,
+                        'balloon_min': min_mem}
         return {}
 
     def setBalloonTarget(self, target):


-- 
To view, visit http://gerrit.ovirt.org/15799
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4fca97bf0d3621883d1320673c648d0fbbd50340
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Sivák <msivak at redhat.com>


More information about the vdsm-patches mailing list