query-sev command is used to get the SEV guest information, fill the SevInfo fields with SEV guest information. Cc: Eric Blake <eblake@xxxxxxxxxx> Cc: "Daniel P. Berrangé" <berrange@xxxxxxxxxx> Cc: "Dr. David Alan Gilbert" <dgilbert@xxxxxxxxxx> Cc: Markus Armbruster <armbru@xxxxxxxxxx> Signed-off-by: Brijesh Singh <brijesh.singh@xxxxxxx> --- qmp.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/qmp.c b/qmp.c index baf0b96528ae..6860ae9ad6ea 100644 --- a/qmp.c +++ b/qmp.c @@ -723,5 +723,15 @@ MemoryInfo *qmp_query_memory_size_summary(Error **errp) SevInfo *qmp_query_sev(Error **errp) { - return NULL; + SevInfo *info = g_malloc0(sizeof(*info)); + + info->enabled = sev_enabled(); + if (info->enabled) { + sev_get_fw_version(&info->api_major, + &info->api_minor, &info->build_id); + sev_get_policy(&info->policy); + info->state = sev_get_current_state(); + } + + return info; } -- 2.14.3