summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2025-07-02 14:44:11 +0200
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2025-07-15 19:28:02 +0200
commit18da42ee4273a66f240bcca7aa4d8ce3b97b1a77 (patch)
tree61186dbdd3021e79f7d2be2f1b22a32360a2be26
parent187aad2896a3775941a9a02ce8d8a4a15970c1e6 (diff)
downloadfocaccia-qemu-18da42ee4273a66f240bcca7aa4d8ce3b97b1a77.tar.gz
focaccia-qemu-18da42ee4273a66f240bcca7aa4d8ce3b97b1a77.zip
qapi/accel: Move definitions related to accelerators in their own file
Extract KVM definitions from machine.json to accelerator.json.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Message-Id: <20250703105540.67664-29-philmd@linaro.org>
-rw-r--r--MAINTAINERS1
-rw-r--r--hw/core/machine-hmp-cmds.c1
-rw-r--r--hw/core/machine-qmp-cmds.c1
-rw-r--r--qapi/accelerator.json39
-rw-r--r--qapi/machine.json29
-rw-r--r--qapi/meson.build1
-rw-r--r--qapi/qapi-schema.json1
7 files changed, 44 insertions, 29 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index e88ed2c0a9..0e945f3bd2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -509,6 +509,7 @@ F: accel/Makefile.objs
 F: accel/stubs/Makefile.objs
 F: cpu-common.c
 F: cpu-target.c
+F: qapi/accelerator.json
 F: system/cpus.c
 
 Apple Silicon HVF CPUs
diff --git a/hw/core/machine-hmp-cmds.c b/hw/core/machine-hmp-cmds.c
index c6325cdcaa..5ca0da77b1 100644
--- a/hw/core/machine-hmp-cmds.c
+++ b/hw/core/machine-hmp-cmds.c
@@ -18,6 +18,7 @@
 #include "monitor/monitor.h"
 #include "qapi/error.h"
 #include "qapi/qapi-builtin-visit.h"
+#include "qapi/qapi-commands-accelerator.h"
 #include "qapi/qapi-commands-machine.h"
 #include "qobject/qdict.h"
 #include "qapi/string-output-visitor.h"
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index d82043e1c6..1af0f29f7d 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -14,6 +14,7 @@
 #include "hw/mem/memory-device.h"
 #include "qapi/error.h"
 #include "qapi/qapi-builtin-visit.h"
+#include "qapi/qapi-commands-accelerator.h"
 #include "qapi/qapi-commands-machine.h"
 #include "qobject/qobject.h"
 #include "qapi/qobject-input-visitor.h"
diff --git a/qapi/accelerator.json b/qapi/accelerator.json
new file mode 100644
index 0000000000..d55fe1aa0a
--- /dev/null
+++ b/qapi/accelerator.json
@@ -0,0 +1,39 @@
+# -*- Mode: Python -*-
+# vim: filetype=python
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+##
+# = Accelerators
+##
+
+{ 'include': 'common.json' }
+
+##
+# @KvmInfo:
+#
+# Information about support for KVM acceleration
+#
+# @enabled: true if KVM acceleration is active
+#
+# @present: true if KVM acceleration is built into this executable
+#
+# Since: 0.14
+##
+{ 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
+
+##
+# @query-kvm:
+#
+# Return information about KVM acceleration
+#
+# Returns: @KvmInfo
+#
+# Since: 0.14
+#
+# .. qmp-example::
+#
+#     -> { "execute": "query-kvm" }
+#     <- { "return": { "enabled": true, "present": true } }
+##
+{ 'command': 'query-kvm', 'returns': 'KvmInfo' }
diff --git a/qapi/machine.json b/qapi/machine.json
index f712e7da6d..f80ba264b5 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -452,35 +452,6 @@
 { 'command': 'inject-nmi' }
 
 ##
-# @KvmInfo:
-#
-# Information about support for KVM acceleration
-#
-# @enabled: true if KVM acceleration is active
-#
-# @present: true if KVM acceleration is built into this executable
-#
-# Since: 0.14
-##
-{ 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
-
-##
-# @query-kvm:
-#
-# Return information about KVM acceleration
-#
-# Returns: @KvmInfo
-#
-# Since: 0.14
-#
-# .. qmp-example::
-#
-#     -> { "execute": "query-kvm" }
-#     <- { "return": { "enabled": true, "present": true } }
-##
-{ 'command': 'query-kvm', 'returns': 'KvmInfo' }
-
-##
 # @NumaOptionsType:
 #
 # @node: NUMA nodes configuration
diff --git a/qapi/meson.build b/qapi/meson.build
index 3b035aea33..ca6b61a608 100644
--- a/qapi/meson.build
+++ b/qapi/meson.build
@@ -57,6 +57,7 @@ qapi_all_modules = [
 ]
 if have_system
   qapi_all_modules += [
+    'accelerator',
     'acpi',
     'audio',
     'cryptodev',
diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json
index a8f66163cb..0477696ff0 100644
--- a/qapi/qapi-schema.json
+++ b/qapi/qapi-schema.json
@@ -37,6 +37,7 @@
 { 'include': 'run-state.json' }
 { 'include': 'crypto.json' }
 { 'include': 'job.json' }
+{ 'include': 'accelerator.json' }
 { 'include': 'block.json' }
 { 'include': 'block-export.json' }
 { 'include': 'char.json' }