qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Subject: [PULL 03/17] qapi/accel: Move definitions related to accelerators in their own file
Date: Tue, 15 Jul 2025 21:45:02 +0200	[thread overview]
Message-ID: <20250715194516.91722-4-philmd@linaro.org> (raw)
In-Reply-To: <20250715194516.91722-1-philmd@linaro.org>

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>
---
 MAINTAINERS                |  1 +
 qapi/accelerator.json      | 39 ++++++++++++++++++++++++++++++++++++++
 qapi/machine.json          | 29 ----------------------------
 qapi/qapi-schema.json      |  1 +
 hw/core/machine-hmp-cmds.c |  1 +
 hw/core/machine-qmp-cmds.c |  1 +
 qapi/meson.build           |  1 +
 7 files changed, 44 insertions(+), 29 deletions(-)
 create mode 100644 qapi/accelerator.json

diff --git a/MAINTAINERS b/MAINTAINERS
index e88ed2c0a97..0e945f3bd26 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/qapi/accelerator.json b/qapi/accelerator.json
new file mode 100644
index 00000000000..d55fe1aa0a3
--- /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 f712e7da6d6..f80ba264b53 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -451,35 +451,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:
 #
diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json
index a8f66163cb7..0477696ff02 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' }
diff --git a/hw/core/machine-hmp-cmds.c b/hw/core/machine-hmp-cmds.c
index c6325cdcaaa..5ca0da77b14 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 d82043e1c68..1af0f29f7d3 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/meson.build b/qapi/meson.build
index 3b035aea339..ca6b61a608d 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',
-- 
2.49.0



  parent reply	other threads:[~2025-07-15 19:59 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-15 19:44 [PULL 00/17] Accelerators patches for 2025-07-15 Philippe Mathieu-Daudé
2025-07-15 19:45 ` [PULL 01/17] hw/xen/arch_hvm: Unify x86 and ARM variants Philippe Mathieu-Daudé
2025-07-15 19:45 ` [PULL 02/17] hw/arm/xen-pvh: Remove unnecessary 'hw/xen/arch_hvm.h' header Philippe Mathieu-Daudé
2025-07-15 19:45 ` Philippe Mathieu-Daudé [this message]
2025-07-15 19:45 ` [PULL 04/17] qapi/machine: Add @qom-type field to CpuInfoFast structure Philippe Mathieu-Daudé
2025-07-15 19:45 ` [PULL 05/17] hw/core/machine: Display CPU model name in 'info cpus' command Philippe Mathieu-Daudé
2025-07-15 19:45 ` [PULL 06/17] accel/tcg: Do not dump NaN statistics Philippe Mathieu-Daudé
2025-07-15 19:45 ` [PULL 07/17] accel: Rename 'system/accel-ops.h' -> 'accel/accel-cpu-ops.h' Philippe Mathieu-Daudé
2025-07-15 19:45 ` [PULL 08/17] accel: Extract AccelClass definition to 'accel/accel-ops.h' Philippe Mathieu-Daudé
2025-07-15 19:45 ` [PULL 09/17] Revert "accel/tcg: Unregister the RCU before exiting RR thread" Philippe Mathieu-Daudé
2025-07-15 19:45 ` [PULL 10/17] accel/tcg: Extract statistic related code to tcg-stats.c Philippe Mathieu-Daudé
2025-07-15 19:45 ` [PULL 11/17] accel/system: Introduce @x-accel-stats QMP command Philippe Mathieu-Daudé
2025-07-15 19:45 ` [PULL 12/17] accel/system: Add 'info accel' on human monitor Philippe Mathieu-Daudé
2025-07-15 19:45 ` [PULL 13/17] accel/tcg: Propagate AccelState to dump_accel_info() Philippe Mathieu-Daudé
2025-07-15 19:45 ` [PULL 14/17] accel/tcg: Implement AccelClass::get_stats() handler Philippe Mathieu-Daudé
2025-07-15 19:45 ` [PULL 15/17] accel/hvf: Implement AccelClass::get_vcpu_stats() handler Philippe Mathieu-Daudé
2025-07-15 19:45 ` [PULL 16/17] system/runstate: Document qemu_add_vm_change_state_handler() Philippe Mathieu-Daudé
2025-07-15 19:45 ` [PULL 17/17] system/runstate: Document qemu_add_vm_change_state_handler_prio* in hdr Philippe Mathieu-Daudé
2025-07-16 12:41 ` [PULL 00/17] Accelerators patches for 2025-07-15 Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250715194516.91722-4-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).