From ee868da6ce693a81e9506e962187ebd662dd69e4 Mon Sep 17 00:00:00 2001 From: Xiaoling Gao Date: Wed, 27 Nov 2024 14:37:09 +0800 Subject: [PATCH] balloon_check: fix the inconsistent comparison When balloon memory to a big value, it means balloon deflation, in guest the in use memory would be reduced; while balloon memory to a small value, it means balloon inflation, in guest the in use memory would be increased. So the calculation method should be updated. Signed-off-by: Xiaoling Gao --- qemu/tests/balloon_check.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qemu/tests/balloon_check.py b/qemu/tests/balloon_check.py index 0f8861d1c6..ce2ef0157a 100644 --- a/qemu/tests/balloon_check.py +++ b/qemu/tests/balloon_check.py @@ -461,7 +461,8 @@ def error_report(self, step, expect_value, monitor_value, guest_value): error_msg = "Wanted to be changed: %s\n" % (expect_value - self.pre_mem) if monitor_value: error_msg += "Changed in monitor: %s\n" % (monitor_value - self.pre_mem) - error_msg += "Changed in guest: %s\n" % (guest_value - self.pre_gmem) + # guest_value and pre_gmem is the memory in use in guest. + error_msg += "Changed in guest: %s\n" % (self.pre_gmem - guest_value) self.test.log.error(error_msg) def get_memory_status(self):