mirror of
https://github.com/qemu/qemu.git
synced 2026-07-08 17:56:38 +00:00
plugins: add API for registering discontinuity callbacks
The plugin API allows registration of callbacks for a variety of VCPU related events, such as VCPU reset, idle and resume. In addition to those events, we recently defined discontinuity events, which include traps. This change introduces a function to register callbacks for these events. We define one distinct plugin event type for each type of discontinuity, granting fine control to plugins in term of which events they receive. Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Julian Ganz <neither@nut.email> Message-ID: <20251027110344.2289945-9-alex.bennee@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
This commit is contained in:
@@ -569,6 +569,21 @@ void qemu_plugin_register_vcpu_resume_cb(qemu_plugin_id_t id,
|
||||
plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_RESUME, cb);
|
||||
}
|
||||
|
||||
void qemu_plugin_register_vcpu_discon_cb(qemu_plugin_id_t id,
|
||||
enum qemu_plugin_discon_type type,
|
||||
qemu_plugin_vcpu_discon_cb_t cb)
|
||||
{
|
||||
if (type & QEMU_PLUGIN_DISCON_INTERRUPT) {
|
||||
plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_INTERRUPT, cb);
|
||||
}
|
||||
if (type & QEMU_PLUGIN_DISCON_EXCEPTION) {
|
||||
plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_EXCEPTION, cb);
|
||||
}
|
||||
if (type & QEMU_PLUGIN_DISCON_HOSTCALL) {
|
||||
plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_HOSTCALL, cb);
|
||||
}
|
||||
}
|
||||
|
||||
void qemu_plugin_register_flush_cb(qemu_plugin_id_t id,
|
||||
qemu_plugin_simple_cb_t cb)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user