From be52d53cc5db01e8a1e5def3f6b1267b9c76be19 Mon Sep 17 00:00:00 2001 From: Zhenchao Liu Date: Wed, 12 Jun 2024 10:53:29 +0800 Subject: [PATCH] Added vm_secure_guest_object_options for secure guest object vm_secure_guest_object_options is used to define secure guest object options, e.g. vm_secure_guest_object_options = debug=on for a tdx-guest object. Signed-off-by: Zhenchao Liu --- virttest/qemu_devices/qcontainer.py | 4 ++++ virttest/shared/cfg/base.cfg | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/virttest/qemu_devices/qcontainer.py b/virttest/qemu_devices/qcontainer.py index 6feaa0046d..ad6d766f46 100644 --- a/virttest/qemu_devices/qcontainer.py +++ b/virttest/qemu_devices/qcontainer.py @@ -3966,6 +3966,10 @@ def _gen_tdx_obj_props(obj_id, params): raise ValueError("Unsupported tdx-guest object") backend, tdx_obj_props = "tdx-guest", {"id": obj_id} + tdx_opts = params.get_dict("vm_secure_guest_object_options") + if tdx_opts: + tdx_obj_props.update(tdx_opts) + return backend, tdx_obj_props obj_props_handlers = {"sev": _gen_sev_obj_props, "tdx": _gen_tdx_obj_props} diff --git a/virttest/shared/cfg/base.cfg b/virttest/shared/cfg/base.cfg index 691036401a..150211253d 100644 --- a/virttest/shared/cfg/base.cfg +++ b/virttest/shared/cfg/base.cfg @@ -1071,6 +1071,10 @@ uuid_dimm = "" # Note: The following types are supported: sev # Disable secure guest: vm_secure_guest_type[_vm1] = "" # +# Set the secure guest object options, use a blank to join more options (optional) +# TODO: Currently this param is used for tdx guest object only +#vm_secure_guest_object_options[_vm1] = "debug=on mrconfigid=xx mrowner=yy" +# # AMD SEV secure guest params # # Set the cbitpos, or specify per-vm values (required)