mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
target/i386/sev: Move qmp_query_sev() & hmp_info_sev() to sev.c
Move qmp_query_sev() & hmp_info_sev()() from monitor.c to sev.c and make sev_get_info() static. We don't need the stub anymore, remove it. Add a stub for hmp_info_sev(). Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20211007161716.453984-22-philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
0875a7038b
commit
aa3950182f
4 changed files with 45 additions and 40 deletions
|
@ -31,7 +31,6 @@
|
|||
#include "qapi/qmp/qerror.h"
|
||||
#include "sysemu/kvm.h"
|
||||
#include "qapi/error.h"
|
||||
#include "sev.h"
|
||||
#include "qapi/qapi-commands-misc-target.h"
|
||||
#include "qapi/qapi-commands-misc.h"
|
||||
#include "hw/i386/pc.h"
|
||||
|
@ -676,40 +675,6 @@ void hmp_info_io_apic(Monitor *mon, const QDict *qdict)
|
|||
"removed soon. Please use 'info pic' instead.\n");
|
||||
}
|
||||
|
||||
SevInfo *qmp_query_sev(Error **errp)
|
||||
{
|
||||
SevInfo *info;
|
||||
|
||||
info = sev_get_info();
|
||||
if (!info) {
|
||||
error_setg(errp, "SEV feature is not available");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
void hmp_info_sev(Monitor *mon, const QDict *qdict)
|
||||
{
|
||||
SevInfo *info = sev_get_info();
|
||||
|
||||
if (info && info->enabled) {
|
||||
monitor_printf(mon, "handle: %d\n", info->handle);
|
||||
monitor_printf(mon, "state: %s\n", SevState_str(info->state));
|
||||
monitor_printf(mon, "build: %d\n", info->build_id);
|
||||
monitor_printf(mon, "api version: %d.%d\n",
|
||||
info->api_major, info->api_minor);
|
||||
monitor_printf(mon, "debug: %s\n",
|
||||
info->policy & SEV_POLICY_NODBG ? "off" : "on");
|
||||
monitor_printf(mon, "key-sharing: %s\n",
|
||||
info->policy & SEV_POLICY_NOKS ? "off" : "on");
|
||||
} else {
|
||||
monitor_printf(mon, "SEV is not enabled\n");
|
||||
}
|
||||
|
||||
qapi_free_SevInfo(info);
|
||||
}
|
||||
|
||||
SGXInfo *qmp_query_sgx(Error **errp)
|
||||
{
|
||||
return sgx_get_info(errp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue