]> git.ipfire.org Git - thirdparty/qemu.git/commit
plugins: Add enforcement of QEMU_PLUGIN_CB flags in register R/W callbacks
authorRowan Hart <rowanbhart@gmail.com>
Fri, 27 Jun 2025 11:25:03 +0000 (12:25 +0100)
committerAlex Bennée <alex.bennee@linaro.org>
Wed, 2 Jul 2025 09:09:48 +0000 (10:09 +0100)
commit766e00bd570f54c8d08023a46cd3386e96ecd39f
tree7e8f4afc7cbc4f0799ce565d5384d9a81dbc880f
parent1a92b65859e2d58dbf4b8356940c42c5834e9710
plugins: Add enforcement of QEMU_PLUGIN_CB flags in register R/W callbacks

This patch adds functionality to enforce the requested QEMU_PLUGIN_CB_
flags level passed when registering a callback function using the
plugins API. Each time a callback is about to be invoked, a thread-local
variable will be updated with the level that callback requested. Then,
called API functions (in particular, the register read and write API)
will call qemu_plugin_get_cb_flags() to check the level is at least the
level they require.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Rowan Hart <rowanbhart@gmail.com>
Message-ID: <20250624175351.440780-4-rowanbhart@gmail.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-ID: <20250627112512.1880708-8-alex.bennee@linaro.org>
accel/tcg/plugin-gen.c
include/hw/core/cpu.h
include/qemu/plugin.h
include/qemu/qemu-plugin.h
plugins/api.c
plugins/core.c