Skip to content

Commit

Permalink
Decoupling memory-backend and hugepage
Browse files Browse the repository at this point in the history
Memory: fix memory-backend cannot change if there's no hugepage when
vm_mem_backend is "memory-backend_file"

Signed-off-by: Boqiao Fu <[email protected]>
  • Loading branch information
fbq815 committed May 9, 2023
1 parent 6dbcb4b commit 8a4ca4a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion virttest/qemu_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1053,8 +1053,14 @@ def add_memorys(devices, params):
name = output[0]
backend_options = {}
backend_options["size_mem"] = "%sM" % params["mem"]
if params.get("vm_mem_backend"):
mem_backend = params.get("vm_mem_backend")
if mem_backend:
backend_options["backend_mem"] = params.get("vm_mem_backend")
if (not params.get("vm_mem_mem-path") and mem_backend ==
"memory-backend-file"):
LOG.error("expect mem-path for %s", mem_backend)
if params.get("vm_mem_mem-path"):
backend_options["mem-path_mem"] = params["vm_mem_mem-path"]
if params.get("hugepage_path"):
backend_options["backend_mem"] = "memory-backend-file"
backend_options["mem-path_mem"] = params["hugepage_path"]
Expand Down

0 comments on commit 8a4ca4a

Please sign in to comment.