diff --git a/virttest/qemu_vm.py b/virttest/qemu_vm.py index b55a48d8330..1d0a8a0193d 100644 --- a/virttest/qemu_vm.py +++ b/virttest/qemu_vm.py @@ -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"]