[PATCH v9 11/29] qmp: populate SevInfo fields with SEV guest information

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

 



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




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux