hw/i386/sgx: Move qmp_query_sgx_capabilities() to hw/i386/sgx.c
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Thu, 7 Oct 2021 17:56:11 +0000 (19:56 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 13 Oct 2021 08:47:49 +0000 (10:47 +0200)
Move qmp_query_sgx_capabilities() from target/i386/monitor.c to
hw/i386/sgx.c, removing the sgx_get_capabilities() indirection.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20211007175612.496366-4-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/i386/sgx-stub.c
hw/i386/sgx.c
include/hw/i386/sgx.h
target/i386/monitor.c

index 45c473119ef06251419f8a469eb87dabbcdaea85..3749656db1a3b62f1858b66fce2ce30b95e6d4ac 100644 (file)
@@ -2,6 +2,8 @@
 #include "hw/i386/pc.h"
 #include "hw/i386/sgx-epc.h"
 #include "hw/i386/sgx.h"
+#include "qapi/error.h"
+#include "qapi/qapi-commands-misc-target.h"
 
 SGXInfo *sgx_get_info(Error **errp)
 {
@@ -9,7 +11,7 @@ SGXInfo *sgx_get_info(Error **errp)
     return NULL;
 }
 
-SGXInfo *sgx_get_capabilities(Error **errp)
+SGXInfo *qmp_query_sgx_capabilities(Error **errp)
 {
     error_setg(errp, "SGX support is not compiled in");
     return NULL;
index 29724ff8f086117452813dbc1b0beb9ae7b4fd6c..713f13634330cdf8ed8a24374b00ce25a76989d0 100644 (file)
@@ -16,6 +16,7 @@
 #include "hw/mem/memory-device.h"
 #include "monitor/qdev.h"
 #include "qapi/error.h"
+#include "qapi/qapi-commands-misc-target.h"
 #include "exec/address-spaces.h"
 #include "hw/i386/sgx.h"
 #include "sysemu/hw_accel.h"
@@ -57,7 +58,7 @@ static uint64_t sgx_calc_host_epc_section_size(void)
     return size;
 }
 
-SGXInfo *sgx_get_capabilities(Error **errp)
+SGXInfo *qmp_query_sgx_capabilities(Error **errp)
 {
     SGXInfo *info = NULL;
     uint32_t eax, ebx, ecx, edx;
index 16fc25725c497554e6702e592cb5ac9afa0cc064..2bf90b3f4fecc776fdd5e288738a0ed5193faa3a 100644 (file)
@@ -7,6 +7,5 @@
 #include "qapi/qapi-types-misc-target.h"
 
 SGXInfo *sgx_get_info(Error **errp);
-SGXInfo *sgx_get_capabilities(Error **errp);
 
 #endif
index 680d282591c63e83a0b3b5897bcc754de55b6b6a..84fba47f1936302e343e48379e1520087257a394 100644 (file)
@@ -700,8 +700,3 @@ void hmp_info_sgx(Monitor *mon, const QDict *qdict)
     monitor_printf(mon, "size: %" PRIu64 "\n",
                    info->section_size);
 }
-
-SGXInfo *qmp_query_sgx_capabilities(Error **errp)
-{
-    return sgx_get_capabilities(errp);
-}