target/i386/sev: Move qmp_query_sev_capabilities() to sev.c

Move qmp_query_sev_capabilities() from monitor.c to sev.c
and make sev_get_capabilities() static. We don't need the
stub anymore, remove it.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20211007161716.453984-20-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Philippe Mathieu-Daudé 2021-10-07 18:17:12 +02:00 committed by Paolo Bonzini
parent 11a6ed0e77
commit 8371df2902
4 changed files with 7 additions and 9 deletions

View File

@ -727,11 +727,6 @@ SevLaunchMeasureInfo *qmp_query_sev_launch_measure(Error **errp)
return info;
}
SevCapability *qmp_query_sev_capabilities(Error **errp)
{
return sev_get_capabilities(errp);
}
SGXInfo *qmp_query_sgx(Error **errp)
{
return sgx_get_info(errp);

View File

@ -27,7 +27,7 @@ char *sev_get_launch_measurement(void)
return NULL;
}
SevCapability *sev_get_capabilities(Error **errp)
SevCapability *qmp_query_sev_capabilities(Error **errp)
{
error_setg(errp, "SEV is not available in this QEMU");
return NULL;

View File

@ -466,8 +466,7 @@ e_free:
return 1;
}
SevCapability *
sev_get_capabilities(Error **errp)
static SevCapability *sev_get_capabilities(Error **errp)
{
SevCapability *cap = NULL;
guchar *pdh_data = NULL;
@ -517,6 +516,11 @@ out:
return cap;
}
SevCapability *qmp_query_sev_capabilities(Error **errp)
{
return sev_get_capabilities(errp);
}
static SevAttestationReport *sev_get_attestation_report(const char *mnonce,
Error **errp)
{

View File

@ -51,7 +51,6 @@ extern SevInfo *sev_get_info(void);
extern uint32_t sev_get_cbit_position(void);
extern uint32_t sev_get_reduced_phys_bits(void);
extern char *sev_get_launch_measurement(void);
extern SevCapability *sev_get_capabilities(Error **errp);
extern bool sev_add_kernel_loader_hashes(SevKernelLoaderContext *ctx, Error **errp);
int sev_encrypt_flash(uint8_t *ptr, uint64_t len, Error **errp);