Skip to content

Commit

Permalink
Merge pull request #5917 from hholoubk/XXX-14917-umask-test-vm-not-st…
Browse files Browse the repository at this point in the history
…arted-aarch64

Resolve test issue with aarch64 and 4k default hp size
  • Loading branch information
dzhengfy authored Oct 29, 2024
2 parents f6a1e5b + 4c1852e commit f0520d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,5 @@
start_vm = "no"
umask_value = '027'
mem_backing_attrs = {'hugepages': {}}
target_hugepages = 1024
aarch64:
target_hugepages = 4
s390-virtio:
kvm_module_parameters = "hpage=1"
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from virttest import utils_libvirtd
from virttest.libvirt_xml import vm_xml
from virttest.libvirt_xml.vm_xml import VMXML
from avocado.utils import memory as avocado_mem


def run(test, params, env):
Expand All @@ -30,6 +31,13 @@ def run(test, params, env):
if os.path.exists(hp_path):
shutil.rmtree(hp_path)
utils_libvirtd.Libvirtd().restart()

# calculate the target_hugepage from VM memory and actual HP size
actual_hp_size = avocado_mem.get_huge_page_size()
target_hugepages = int(vmxml.memory / actual_hp_size)
params["target_hugepages"] = target_hugepages
test.log.debug(f"Requred VM memory {vmxml.memory}, calculated tareget_hugepages: {target_hugepages}")

hp_cfg = test_setup.HugePageConfig(params)
hp_cfg.set_hugepages()

Expand Down

0 comments on commit f0520d3

Please sign in to comment.