mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
machine: add memory-encryption option
When CPU supports memory encryption feature, the property can be used to specify the encryption object to use when launching an encrypted guest. Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Eduardo Habkost <ehabkost@redhat.com> Cc: Marcel Apfelbaum <marcel@redhat.com> Cc: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
e13713db5b
commit
db5881949f
3 changed files with 27 additions and 1 deletions
|
@ -334,6 +334,22 @@ static bool machine_get_enforce_config_section(Object *obj, Error **errp)
|
|||
return ms->enforce_config_section;
|
||||
}
|
||||
|
||||
static char *machine_get_memory_encryption(Object *obj, Error **errp)
|
||||
{
|
||||
MachineState *ms = MACHINE(obj);
|
||||
|
||||
return g_strdup(ms->memory_encryption);
|
||||
}
|
||||
|
||||
static void machine_set_memory_encryption(Object *obj, const char *value,
|
||||
Error **errp)
|
||||
{
|
||||
MachineState *ms = MACHINE(obj);
|
||||
|
||||
g_free(ms->memory_encryption);
|
||||
ms->memory_encryption = g_strdup(value);
|
||||
}
|
||||
|
||||
void machine_class_allow_dynamic_sysbus_dev(MachineClass *mc, const char *type)
|
||||
{
|
||||
strList *item = g_new0(strList, 1);
|
||||
|
@ -612,6 +628,12 @@ static void machine_class_init(ObjectClass *oc, void *data)
|
|||
&error_abort);
|
||||
object_class_property_set_description(oc, "enforce-config-section",
|
||||
"Set on to enforce configuration section migration", &error_abort);
|
||||
|
||||
object_class_property_add_str(oc, "memory-encryption",
|
||||
machine_get_memory_encryption, machine_set_memory_encryption,
|
||||
&error_abort);
|
||||
object_class_property_set_description(oc, "memory-encryption",
|
||||
"Set memory encyption object to use", &error_abort);
|
||||
}
|
||||
|
||||
static void machine_class_base_init(ObjectClass *oc, void *data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue