From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: stefanha@redhat.com, "Daniel P. Berrangé" <berrange@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"David Woodhouse" <dwmw@amazon.co.uk>,
"Pierrick Bouvier" <pierrick.bouvier@linaro.org>
Subject: [PULL 06/13] qapi: make Xen event commands unconditionally available
Date: Wed, 28 May 2025 20:31:44 +0200 [thread overview]
Message-ID: <20250528183151.2839034-7-armbru@redhat.com> (raw)
In-Reply-To: <20250528183151.2839034-1-armbru@redhat.com>
From: Daniel P. Berrangé <berrange@redhat.com>
This removes the TARGET_I386 condition from the Xen event channel
commands, moving them to the recently introduced misc-i386.json
QAPI file, given they are inherantly i386 specific commands.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Acked-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20250522190542.588267-7-pierrick.bouvier@linaro.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
---
qapi/misc-i386.json | 107 +++++++++++++++++++++++++++++++++++++
qapi/misc-target.json | 111 ---------------------------------------
hw/i386/kvm/xen-stubs.c | 13 -----
hw/i386/kvm/xen_evtchn.c | 2 +-
stubs/monitor-i386-xen.c | 16 ++++++
stubs/meson.build | 1 +
6 files changed, 125 insertions(+), 125 deletions(-)
create mode 100644 stubs/monitor-i386-xen.c
diff --git a/qapi/misc-i386.json b/qapi/misc-i386.json
index d5d1af55a4..3f88a5b28e 100644
--- a/qapi/misc-i386.json
+++ b/qapi/misc-i386.json
@@ -377,3 +377,110 @@
# {"node": 1, "size": 29360128}]} }
##
{ 'command': 'query-sgx-capabilities', 'returns': 'SgxInfo' }
+
+##
+# @EvtchnPortType:
+#
+# An enumeration of Xen event channel port types.
+#
+# @closed: The port is unused.
+#
+# @unbound: The port is allocated and ready to be bound.
+#
+# @interdomain: The port is connected as an interdomain interrupt.
+#
+# @pirq: The port is bound to a physical IRQ (PIRQ).
+#
+# @virq: The port is bound to a virtual IRQ (VIRQ).
+#
+# @ipi: The post is an inter-processor interrupt (IPI).
+#
+# Since: 8.0
+##
+{ 'enum': 'EvtchnPortType',
+ 'data': ['closed', 'unbound', 'interdomain', 'pirq', 'virq', 'ipi'] }
+
+##
+# @EvtchnInfo:
+#
+# Information about a Xen event channel port
+#
+# @port: the port number
+#
+# @vcpu: target vCPU for this port
+#
+# @type: the port type
+#
+# @remote-domain: remote domain for interdomain ports
+#
+# @target: remote port ID, or virq/pirq number
+#
+# @pending: port is currently active pending delivery
+#
+# @masked: port is masked
+#
+# Since: 8.0
+##
+{ 'struct': 'EvtchnInfo',
+ 'data': {'port': 'uint16',
+ 'vcpu': 'uint32',
+ 'type': 'EvtchnPortType',
+ 'remote-domain': 'str',
+ 'target': 'uint16',
+ 'pending': 'bool',
+ 'masked': 'bool'} }
+
+
+##
+# @xen-event-list:
+#
+# Query the Xen event channels opened by the guest.
+#
+# Returns: list of open event channel ports.
+#
+# Since: 8.0
+#
+# .. qmp-example::
+#
+# -> { "execute": "xen-event-list" }
+# <- { "return": [
+# {
+# "pending": false,
+# "port": 1,
+# "vcpu": 1,
+# "remote-domain": "qemu",
+# "masked": false,
+# "type": "interdomain",
+# "target": 1
+# },
+# {
+# "pending": false,
+# "port": 2,
+# "vcpu": 0,
+# "remote-domain": "",
+# "masked": false,
+# "type": "virq",
+# "target": 0
+# }
+# ]
+# }
+##
+{ 'command': 'xen-event-list',
+ 'returns': ['EvtchnInfo'] }
+
+##
+# @xen-event-inject:
+#
+# Inject a Xen event channel port (interrupt) to the guest.
+#
+# @port: The port number
+#
+# Since: 8.0
+#
+# .. qmp-example::
+#
+# -> { "execute": "xen-event-inject", "arguments": { "port": 1 } }
+# <- { "return": { } }
+##
+{ 'command': 'xen-event-inject',
+ 'data': { 'port': 'uint32' } }
diff --git a/qapi/misc-target.json b/qapi/misc-target.json
index d62db37d7c..c9ea1ab23e 100644
--- a/qapi/misc-target.json
+++ b/qapi/misc-target.json
@@ -1,114 +1,3 @@
# -*- Mode: Python -*-
# vim: filetype=python
#
-
-##
-# @EvtchnPortType:
-#
-# An enumeration of Xen event channel port types.
-#
-# @closed: The port is unused.
-#
-# @unbound: The port is allocated and ready to be bound.
-#
-# @interdomain: The port is connected as an interdomain interrupt.
-#
-# @pirq: The port is bound to a physical IRQ (PIRQ).
-#
-# @virq: The port is bound to a virtual IRQ (VIRQ).
-#
-# @ipi: The post is an inter-processor interrupt (IPI).
-#
-# Since: 8.0
-##
-{ 'enum': 'EvtchnPortType',
- 'data': ['closed', 'unbound', 'interdomain', 'pirq', 'virq', 'ipi'],
- 'if': 'TARGET_I386' }
-
-##
-# @EvtchnInfo:
-#
-# Information about a Xen event channel port
-#
-# @port: the port number
-#
-# @vcpu: target vCPU for this port
-#
-# @type: the port type
-#
-# @remote-domain: remote domain for interdomain ports
-#
-# @target: remote port ID, or virq/pirq number
-#
-# @pending: port is currently active pending delivery
-#
-# @masked: port is masked
-#
-# Since: 8.0
-##
-{ 'struct': 'EvtchnInfo',
- 'data': {'port': 'uint16',
- 'vcpu': 'uint32',
- 'type': 'EvtchnPortType',
- 'remote-domain': 'str',
- 'target': 'uint16',
- 'pending': 'bool',
- 'masked': 'bool'},
- 'if': 'TARGET_I386' }
-
-
-##
-# @xen-event-list:
-#
-# Query the Xen event channels opened by the guest.
-#
-# Returns: list of open event channel ports.
-#
-# Since: 8.0
-#
-# .. qmp-example::
-#
-# -> { "execute": "xen-event-list" }
-# <- { "return": [
-# {
-# "pending": false,
-# "port": 1,
-# "vcpu": 1,
-# "remote-domain": "qemu",
-# "masked": false,
-# "type": "interdomain",
-# "target": 1
-# },
-# {
-# "pending": false,
-# "port": 2,
-# "vcpu": 0,
-# "remote-domain": "",
-# "masked": false,
-# "type": "virq",
-# "target": 0
-# }
-# ]
-# }
-##
-{ 'command': 'xen-event-list',
- 'returns': ['EvtchnInfo'],
- 'if': 'TARGET_I386' }
-
-##
-# @xen-event-inject:
-#
-# Inject a Xen event channel port (interrupt) to the guest.
-#
-# @port: The port number
-#
-# Since: 8.0
-#
-# .. qmp-example::
-#
-# -> { "execute": "xen-event-inject", "arguments": { "port": 1 } }
-# <- { "return": { } }
-##
-{ 'command': 'xen-event-inject',
- 'data': { 'port': 'uint32' },
- 'if': 'TARGET_I386' }
diff --git a/hw/i386/kvm/xen-stubs.c b/hw/i386/kvm/xen-stubs.c
index d03131e686..ce73119ee7 100644
--- a/hw/i386/kvm/xen-stubs.c
+++ b/hw/i386/kvm/xen-stubs.c
@@ -12,7 +12,6 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
-#include "qapi/qapi-commands-misc-target.h"
#include "xen_evtchn.h"
#include "xen_primary_console.h"
@@ -38,15 +37,3 @@ void xen_primary_console_create(void)
void xen_primary_console_set_be_port(uint16_t port)
{
}
-#ifdef TARGET_I386
-EvtchnInfoList *qmp_xen_event_list(Error **errp)
-{
- error_setg(errp, "Xen event channel emulation not enabled");
- return NULL;
-}
-
-void qmp_xen_event_inject(uint32_t port, Error **errp)
-{
- error_setg(errp, "Xen event channel emulation not enabled");
-}
-#endif
diff --git a/hw/i386/kvm/xen_evtchn.c b/hw/i386/kvm/xen_evtchn.c
index b5190549a8..dd566c4967 100644
--- a/hw/i386/kvm/xen_evtchn.c
+++ b/hw/i386/kvm/xen_evtchn.c
@@ -19,7 +19,7 @@
#include "monitor/monitor.h"
#include "monitor/hmp.h"
#include "qapi/error.h"
-#include "qapi/qapi-commands-misc-target.h"
+#include "qapi/qapi-commands-misc-i386.h"
#include "qobject/qdict.h"
#include "qom/object.h"
#include "exec/target_page.h"
diff --git a/stubs/monitor-i386-xen.c b/stubs/monitor-i386-xen.c
new file mode 100644
index 0000000000..95b826f979
--- /dev/null
+++ b/stubs/monitor-i386-xen.c
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include "qemu/osdep.h"
+#include "qapi/error.h"
+#include "qapi/qapi-commands-misc-i386.h"
+
+EvtchnInfoList *qmp_xen_event_list(Error **errp)
+{
+ error_setg(errp, "Xen event channel emulation not enabled");
+ return NULL;
+}
+
+void qmp_xen_event_inject(uint32_t port, Error **errp)
+{
+ error_setg(errp, "Xen event channel emulation not enabled");
+}
diff --git a/stubs/meson.build b/stubs/meson.build
index f2eb488018..0ef11976a2 100644
--- a/stubs/meson.build
+++ b/stubs/meson.build
@@ -81,6 +81,7 @@ if have_system
stub_ss.add(files('monitor-i386-rtc.c'))
stub_ss.add(files('monitor-i386-sev.c'))
stub_ss.add(files('monitor-i386-sgx.c'))
+ stub_ss.add(files('monitor-i386-xen.c'))
endif
if have_system or have_user
--
2.48.1
next prev parent reply other threads:[~2025-05-28 18:33 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-28 18:31 [PULL 00/13] QAPI patches patches for 2025-05-28 Markus Armbruster
2025-05-28 18:31 ` [PULL 01/13] qapi: expose rtc-reset-reinjection command unconditionally Markus Armbruster
2025-05-28 18:31 ` [PULL 02/13] qapi: expand docs for SEV commands Markus Armbruster
2025-05-28 18:31 ` [PULL 03/13] qapi: make SEV commands unconditionally available Markus Armbruster
2025-05-28 18:31 ` [PULL 04/13] qapi: expose query-gic-capability command unconditionally Markus Armbruster
2025-05-28 18:31 ` [PULL 05/13] qapi: make SGX commands unconditionally available Markus Armbruster
2025-05-28 18:31 ` Markus Armbruster [this message]
2025-05-28 18:31 ` [PULL 07/13] qapi: remove the misc-target.json file Markus Armbruster
2025-05-28 18:31 ` [PULL 08/13] qapi: Make CpuModelExpansionInfo::deprecated-props optional and generic Markus Armbruster
2025-05-28 18:31 ` [PULL 09/13] qapi: make most CPU commands unconditionally available Markus Armbruster
2025-05-28 18:31 ` [PULL 10/13] qapi: make s390x specific " Markus Armbruster
2025-05-28 18:31 ` [PULL 11/13] qapi: remove qapi_specific_outputs from meson.build Markus Armbruster
2025-05-28 18:31 ` [PULL 12/13] qapi: make all generated files common Markus Armbruster
2025-05-28 18:31 ` [PULL 13/13] qapi: use imperative style in documentation Markus Armbruster
2025-05-29 14:56 ` [PULL 00/13] QAPI patches patches for 2025-05-28 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=20250528183151.2839034-7-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=dwmw@amazon.co.uk \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=stefanha@redhat.com \
/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).