Message ID | 148900636610.27090.7472863810631270644.stgit@brijesh-build-machine (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 03/08/2017 02:52 PM, Brijesh Singh wrote: > update 'info kvm' to display the memory encryption support. > > (qemu) info kvm > kvm support: enabled > memory encryption: disabled > > Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> > --- > +++ b/qapi-schema.json > @@ -185,9 +185,12 @@ > # > # @present: true if KVM acceleration is built into this executable > # > +# @mem-encryption: true if Memory Encryption is active (since 2.8) You've missed 2.8, and probably even 2.9, unless you can argue that this is a bug-fix appropriate during soft freeze. So this should be since 2.10. > +# > # Since: 0.14.0 > ## > -{ 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} } > +{ 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool', > + 'mem-encryption' : 'bool'} } >
diff --git a/hmp.c b/hmp.c index 261843f..0b8b315 100644 --- a/hmp.c +++ b/hmp.c @@ -83,6 +83,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 6febfa7..e1dc847 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -185,9 +185,12 @@ # # @present: true if KVM acceleration is built into this executable # +# @mem-encryption: true if Memory Encryption is active (since 2.8) +# # Since: 0.14.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 fa82b59..7b61c43 100644 --- a/qmp.c +++ b/qmp.c @@ -69,6 +69,7 @@ KvmInfo *qmp_query_kvm(Error **errp) info->enabled = kvm_enabled(); info->present = kvm_available(); + info->mem_encryption = kvm_memcrypt_enabled(); return info; }
update 'info kvm' to display the memory encryption support. (qemu) info kvm kvm support: enabled memory encryption: disabled Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> --- hmp.c | 2 ++ qapi-schema.json | 5 ++++- qmp.c | 1 + 3 files changed, 7 insertions(+), 1 deletion(-)