Skip to content

Commit

Permalink
Merge pull request #3666 from fbq815/2187577
Browse files Browse the repository at this point in the history
Add new parameter to support changing backend mem path
  • Loading branch information
YongxueHong authored Aug 15, 2023
2 parents c992d68 + 85915c0 commit fe0abdc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions virttest/qemu_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,11 @@ def add_memorys(devices, params):
backend_options["size_mem"] = "%sM" % params["mem"]
if params.get("vm_mem_backend"):
backend_options["backend_mem"] = params.get("vm_mem_backend")
if params.get("vm_mem_backend") == "memory-backend-file":
if not params.get("vm_mem_backend_path"):
raise virt_vm.VMConfigMissingError(self.name,
'vm_mem_backend_path')
backend_options["mem-path_mem"] = params["vm_mem_backend_path"]
if params.get("hugepage_path"):
backend_options["backend_mem"] = "memory-backend-file"
backend_options["mem-path_mem"] = params["hugepage_path"]
Expand Down
3 changes: 3 additions & 0 deletions virttest/shared/cfg/base.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ mem = 1024
# Pattern for check memory size inside guest
mem_chk_re_str = ([0-9]+)

# To configure the 'mem-path' for the 'memory-backend' of machine
# vm_mem_backend_path = /dev/shm

# To configure guest backed by hugepages, set it to "yes"
# hugepage = "no"

Expand Down

0 comments on commit fe0abdc

Please sign in to comment.