Skip to content

Commit a6d1df2

Browse files
committed
test(memory_monitor): exclude snapshot bounce buffer
When taking a snapshot from a Secret Free VM, we create a bounce buffer to be able to pass it to the host kernel to store in a file. Exclude it from the memory monitor calculation. Signed-off-by: Nikita Kalyazin <[email protected]>
1 parent e39667c commit a6d1df2

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tests/host_tools/memory.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,16 @@ def is_guest_mem(self, size, guest_mem_bytes):
9393
# - its size matches the guest memory exactly
9494
# - its size is 3328M
9595
# - its size is guest memory minus 3328M.
96-
return size in (
97-
guest_mem_bytes,
98-
self.X86_MEMORY_GAP_START,
99-
guest_mem_bytes - self.X86_MEMORY_GAP_START,
96+
# Note: we add a workaround for Secret Free VMs
97+
# to also exclude the snapshot bounce buffer VMA from the check.
98+
return (
99+
size
100+
in (
101+
guest_mem_bytes,
102+
self.X86_MEMORY_GAP_START,
103+
guest_mem_bytes - self.X86_MEMORY_GAP_START,
104+
)
105+
or size > guest_mem_bytes
100106
)
101107

102108
def check_samples(self):

0 commit comments

Comments
 (0)