aboutsummaryrefslogtreecommitdiff
path: root/plugins/loader.c
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2025-03-04 22:24:32 +0000
committerAlex Bennée <alex.bennee@linaro.org>2025-03-10 10:30:01 +0000
commit8c15f6e435a15e90456d26ff26199861369c9d63 (patch)
treeb0bc72336f281e771c6e51d67291f89ad86ac608 /plugins/loader.c
parent5dd09b8157a132468547ad8a392ec9f8d836c169 (diff)
downloadqemu-8c15f6e435a15e90456d26ff26199861369c9d63.zip
qemu-8c15f6e435a15e90456d26ff26199861369c9d63.tar.gz
qemu-8c15f6e435a15e90456d26ff26199861369c9d63.tar.bz2
plugins/loader: compile loader only once
There is very little in loader that is different between builds save for a tiny user/system mode difference in the plugin_info structure. Create two new files, user and system to hold mode specific helpers and move loader into common_ss. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20250304222439.2035603-26-alex.bennee@linaro.org>
Diffstat (limited to 'plugins/loader.c')
-rw-r--r--plugins/loader.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/plugins/loader.c b/plugins/loader.c
index 827473c..7523d55 100644
--- a/plugins/loader.c
+++ b/plugins/loader.c
@@ -31,9 +31,6 @@
#include "qemu/memalign.h"
#include "hw/core/cpu.h"
#include "exec/tb-flush.h"
-#ifndef CONFIG_USER_ONLY
-#include "hw/boards.h"
-#endif
#include "plugin.h"
@@ -300,14 +297,8 @@ int qemu_plugin_load_list(QemuPluginList *head, Error **errp)
info->target_name = target_name();
info->version.min = QEMU_PLUGIN_MIN_VERSION;
info->version.cur = QEMU_PLUGIN_VERSION;
-#ifndef CONFIG_USER_ONLY
- MachineState *ms = MACHINE(qdev_get_machine());
- info->system_emulation = true;
- info->system.smp_vcpus = ms->smp.cpus;
- info->system.max_vcpus = ms->smp.max_cpus;
-#else
- info->system_emulation = false;
-#endif
+
+ qemu_plugin_fillin_mode_info(info);
QTAILQ_FOREACH_SAFE(desc, head, entry, next) {
int err;