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 Apr 20, 2023
1 parent 6dbcb4b commit 58ae176
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("mem-path_mem") 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 58ae176

Please sign in to comment.