When configuring QEMU with --without-default-devices and
not including machines using a GIC, the GIC model is not
built in but the 'query-gic-capabilities' command still
returns false hopes about GIC:
{"execute": "query-gic-capabilities"}
{"return": [{"emulated": true, "version": 3, "kernel": false}, {"emulated": true,
"version": 2, "kernel": false}]}
Restrict the command to when the GIC is available. If it
isn't we'll get:
{ "execute": "query-gic-capabilities" }
{"error": {"class": "CommandNotFound", "desc": "The command
query-gic-capabilities has not been found"}}
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2484
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
qapi/misc-target.json | 4 ++--
hw/intc/arm_gic_qmp.c | 2 ++
hw/intc/meson.build | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/qapi/misc-target.json b/qapi/misc-target.json
index 8d70bd24d8..b857e44c2e 100644
--- a/qapi/misc-target.json
+++ b/qapi/misc-target.json
@@ -316,7 +316,7 @@
'data': { 'version': 'int',
'emulated': 'bool',
'kernel': 'bool' },
- 'if': 'TARGET_ARM' }
+ 'if': 'CONFIG_ARM_GIC' }
##
# @query-gic-capabilities:
@@ -335,7 +335,7 @@
# { "version": 3, "emulated": false, "kernel": true } ] }
##
{ 'command': 'query-gic-capabilities', 'returns': ['GICCapability'],
- 'if': 'TARGET_ARM' }
+ 'if': 'CONFIG_ARM_GIC' }
##
# @SGXEPCSection:
diff --git a/hw/intc/arm_gic_qmp.c b/hw/intc/arm_gic_qmp.c
index 71056a0c10..1fc79c775b 100644
--- a/hw/intc/arm_gic_qmp.c
+++ b/hw/intc/arm_gic_qmp.c
@@ -6,6 +6,8 @@
#include "qemu/osdep.h"
#include "qapi/util.h"
+
+#include CONFIG_DEVICES