mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-18 23:52:14 -06:00
qapi: make Xen event commands unconditionally available
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>
This commit is contained in:
parent
28a6a99834
commit
4b679a94c6
6 changed files with 125 additions and 125 deletions
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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' } }
|
||||
|
|
|
@ -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' }
|
||||
|
|
|
@ -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
|
||||
|
|
16
stubs/monitor-i386-xen.c
Normal file
16
stubs/monitor-i386-xen.c
Normal file
|
@ -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");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue