From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45997) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn5NA-0000yI-68 for qemu-devel@nongnu.org; Thu, 22 Sep 2016 10:53:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bn5N5-0007sO-6i for qemu-devel@nongnu.org; Thu, 22 Sep 2016 10:53:12 -0400 Received: from mail-sn1nam02on0087.outbound.protection.outlook.com ([104.47.36.87]:59853 helo=NAM02-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn5N4-0007s6-V8 for qemu-devel@nongnu.org; Thu, 22 Sep 2016 10:53:07 -0400 From: Brijesh Singh Date: Thu, 22 Sep 2016 10:52:59 -0400 Message-ID: <147455597948.8519.11161523289950636174.stgit@brijesh-build-machine> In-Reply-To: <147455590865.8519.11191009507297313736.stgit@brijesh-build-machine> References: <147455590865.8519.11191009507297313736.stgit@brijesh-build-machine> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [RFC PATCH v2 07/16] hmp: display memory encryption support in 'info kvm' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: ehabkost@redhat.com, crosthwaite.peter@gmail.com, armbru@redhat.com, mst@redhat.com, p.fedin@samsung.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, pbonzini@redhat.com, rth@twiddle.net update 'info kvm' to display the memory encryption support. (qemu) info kvm kvm support: enabled memory encryption: disabled Signed-off-by: Brijesh Singh --- hmp.c | 2 ++ qapi-schema.json | 7 +++++-- qmp.c | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hmp.c b/hmp.c index cc2056e..11e4005 100644 --- a/hmp.c +++ b/hmp.c @@ -81,6 +81,8 @@ void hmp_info_kvm(Monitor *mon, const QDict *qdict) monitor_printf(mon, "kvm support: "); if (info->present) { monitor_printf(mon, "%s\n", info->enabled ? "enabled" : "disabled"); + monitor_printf(mon, "memory encryption: %s\n", + info->mem_encryption ? "enabled" : "disabled"); } else { monitor_printf(mon, "not compiled\n"); } diff --git a/qapi-schema.json b/qapi-schema.json index 5658723..ce7b7e9 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -99,9 +99,12 @@ # # @present: true if KVM acceleration is built into this executable # -# Since: 0.14.0 +# @mem_encryption: true if Memory Encryption is active +# +# Since: 2.8.0 ## -{ 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} } +{ 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool', + 'mem_encryption' : 'bool'} } ## # @query-kvm: diff --git a/qmp.c b/qmp.c index b6d531e..62f3e60 100644 --- a/qmp.c +++ b/qmp.c @@ -77,6 +77,7 @@ KvmInfo *qmp_query_kvm(Error **errp) info->enabled = kvm_enabled(); info->present = kvm_available(); + info->mem_encryption = kvm_memory_encryption_enabled(); return info; }