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

Change subject: Use the current balloon size from libvirt info
......................................................................

Use the current balloon size from libvirt info

This patch changes our current data source for balloon information
from internal vdsm balloon target to the real live data provided
by libvirt.

The old target value is now reported as balloon_target.

Change-Id: Id66d602da3a7c2306aad4363ef231a524ac6234c
Signed-off-by: Martin Sivak <[email protected]>
---
M vdsm/vm.py
M vdsm_api/vdsmapi-schema.json
2 files changed, 7 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/09/17109/1

diff --git a/vdsm/vm.py b/vdsm/vm.py
index a630e39..0da06a9 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -4275,9 +4275,10 @@
                     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)
+                target_mem = dev.get('target', max_mem)
+                cur_mem = self._dom.info()[2]
                 return {'balloon_max': max_mem, 'balloon_cur': cur_mem,
-                        'balloon_min': min_mem}
+                        'balloon_min': min_mem, 'balloon_target': target_mem}
         return {}
 
     def setBalloonTarget(self, target):
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index 7c39e77..a7a175b 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -5202,10 +5202,13 @@
 #
 # @balloon_min:  The minimum amount of memory guaranteed to the guest (in KiB)
 #
+# @balloon_target:  The amount of memory requested (in KiB)
+#
 # Since: 4.10.0
 ##
 {'type': 'BalloonInfo',
- 'data': {'balloon_max': 'uint', 'balloon_cur': 'uint', 'balloon_min': 'uint'}}
+ 'data': {'balloon_max': 'uint', 'balloon_cur': 'uint', 'balloon_min': 'uint',
+          'balloon_target': 'uint'}}
 
 ##
 # @GuestMountInfo:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id66d602da3a7c2306aad4363ef231a524ac6234c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Sivák <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to