summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorAlex Bennée2019-10-11 17:34:05 +0200
committerAlex Bennée2019-10-28 16:12:38 +0100
commitca76a66975f018c323cb609c0c55a4c8d4acde3b (patch)
tree924f16d7c93f6d4fe9fe1cba8f818bf1718540ed /plugins
parentplugin: add qemu_plugin_insn_disas helper (diff)
downloadqemu-ca76a66975f018c323cb609c0c55a4c8d4acde3b.tar.gz
qemu-ca76a66975f018c323cb609c0c55a4c8d4acde3b.tar.xz
qemu-ca76a66975f018c323cb609c0c55a4c8d4acde3b.zip
plugin: add qemu_plugin_outs helper
Having the plugins grab stdout and spew stuff there is a bit ugly and certainly makes the tests look ugly. Provide a hook back into QEMU which can be redirected as needed. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Aaron Lindsay <aaron@os.amperecomputing.com>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/api.c8
-rw-r--r--plugins/qemu-plugins.symbols1
2 files changed, 9 insertions, 0 deletions
diff --git a/plugins/api.c b/plugins/api.c
index 5adc4d25a1..fa1d9f276d 100644
--- a/plugins/api.c
+++ b/plugins/api.c
@@ -331,3 +331,11 @@ int qemu_plugin_n_max_vcpus(void)
return get_ms()->smp.max_cpus;
#endif
}
+
+/*
+ * Plugin output
+ */
+void qemu_plugin_outs(const char *string)
+{
+ qemu_log_mask(CPU_LOG_PLUGIN, "%s", string);
+}
diff --git a/plugins/qemu-plugins.symbols b/plugins/qemu-plugins.symbols
index 267ec381b4..4bdb381f48 100644
--- a/plugins/qemu-plugins.symbols
+++ b/plugins/qemu-plugins.symbols
@@ -36,4 +36,5 @@
qemu_plugin_vcpu_for_each;
qemu_plugin_n_vcpus;
qemu_plugin_n_max_vcpus;
+ qemu_plugin_outs;
};