qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v9 11/29] qmp: populate SevInfo fields with SEV gues


From: Brijesh Singh
Subject: [Qemu-devel] [PATCH v9 11/29] qmp: populate SevInfo fields with SEV guest information
Date: Thu, 15 Feb 2018 09:39:37 -0600

query-sev command is used to get the SEV guest information, fill the
SevInfo fields with SEV guest information.

Cc: Eric Blake <address@hidden>
Cc: "Daniel P. Berrangé" <address@hidden>
Cc: "Dr. David Alan Gilbert" <address@hidden>
Cc: Markus Armbruster <address@hidden>
Signed-off-by: Brijesh Singh <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]