[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC 5/6] vl: support -plugin option
From: |
Emilio G. Cota |
Subject: |
[Qemu-devel] [RFC 5/6] vl: support -plugin option |
Date: |
Wed, 6 Sep 2017 16:28:47 -0400 |
From: Lluís Vilanova <address@hidden>
Signed-off-by: Lluís Vilanova <address@hidden>
[ cota: s/instrument/plugin ]
Signed-off-by: Emilio G. Cota <address@hidden>
---
vl.c | 10 ++++++++++
qemu-options.hx | 17 +++++++++++++++++
2 files changed, 27 insertions(+)
diff --git a/vl.c b/vl.c
index fb6b2ef..d3d8adc 100644
--- a/vl.c
+++ b/vl.c
@@ -118,6 +118,7 @@ int main(int argc, char **argv)
#include "trace-root.h"
#include "trace/control.h"
+#include "qemu/plugin.h"
#include "qemu/queue.h"
#include "sysemu/arch_init.h"
@@ -3031,6 +3032,7 @@ int main(int argc, char **argv, char **envp)
} BlockdevOptions_queue;
QSIMPLEQ_HEAD(, BlockdevOptions_queue) bdo_queue
= QSIMPLEQ_HEAD_INITIALIZER(bdo_queue);
+ struct qemu_plugin_list plugin_list = QTAILQ_HEAD_INITIALIZER(plugin_list);
module_call_init(MODULE_INIT_TRACE);
@@ -3058,6 +3060,7 @@ int main(int argc, char **argv, char **envp)
qemu_add_opts(&qemu_global_opts);
qemu_add_opts(&qemu_mon_opts);
qemu_add_opts(&qemu_trace_opts);
+ qemu_plugin_add_opts();
qemu_add_opts(&qemu_option_rom_opts);
qemu_add_opts(&qemu_machine_opts);
qemu_add_opts(&qemu_accel_opts);
@@ -3999,6 +4002,9 @@ int main(int argc, char **argv, char **envp)
g_free(trace_file);
trace_file = trace_opt_parse(optarg);
break;
+ case QEMU_OPTION_plugin:
+ qemu_plugin_opt_parse(optarg, &plugin_list);
+ break;
case QEMU_OPTION_readconfig:
{
int ret = qemu_read_config_file(optarg);
@@ -4185,6 +4191,10 @@ int main(int argc, char **argv, char **envp)
}
trace_init_file(trace_file);
+ if (qemu_plugin_load_list(&plugin_list)) {
+ exit(1);
+ }
+
/* Open the logfile at this point and set the log mask if necessary.
*/
if (log_file) {
diff --git a/qemu-options.hx b/qemu-options.hx
index 746b5fa..34557e6 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -4064,6 +4064,23 @@ HXCOMM HX does not support conditional compilation of
text.
@findex -trace
@include qemu-option-trace.texi
ETEXI
+DEF("plugin", HAS_ARG, QEMU_OPTION_plugin,
+ "-plugin [file=]<file>[,arg=<string>]\n"
+ " load a plugin\n",
+ QEMU_ARCH_ALL)
+STEXI
address@hidden -plugin address@hidden,address@hidden
address@hidden -plugin
+
+Load a plugin.
+
address@hidden @option
address@hidden address@hidden
+Load the given plugin from a shared library file.
address@hidden address@hidden
+Argument string passed to the plugin. (Can be given multiple times.)
address@hidden table
+ETEXI
HXCOMM Internal use
DEF("qtest", HAS_ARG, QEMU_OPTION_qtest, "", QEMU_ARCH_ALL)
--
2.7.4
- [Qemu-devel] [RFC 0/6] initial plugin support, Emilio G. Cota, 2017/09/06
- [Qemu-devel] [RFC 6/6] linux-user: support -plugin option, Emilio G. Cota, 2017/09/06
- [Qemu-devel] [RFC 3/6] configure: add --enable-plugins, Emilio G. Cota, 2017/09/06
- [Qemu-devel] [RFC 4/6] Makefile: install qemu-api.h as include/qemu-plugin.h, Emilio G. Cota, 2017/09/06
- [Qemu-devel] [RFC 5/6] vl: support -plugin option,
Emilio G. Cota <=
- [Qemu-devel] [RFC 1/6] tcg: keep a pointer to the current TB in TCGContext, Emilio G. Cota, 2017/09/06
- [Qemu-devel] [RFC 2/6] plugin: add initial plugin support, Emilio G. Cota, 2017/09/06
- Re: [Qemu-devel] [RFC 0/6] initial plugin support, Peter Maydell, 2017/09/14
- Re: [Qemu-devel] [RFC 0/6] initial plugin support, Stefan Hajnoczi, 2017/09/18
- Re: [Qemu-devel] [RFC 0/6] initial plugin support, Thomas Huth, 2017/09/26