From nobody Thu Nov 6 10:38:56 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1540488852390140.5901798245285; Thu, 25 Oct 2018 10:34:12 -0700 (PDT) Received: from localhost ([::1]:56073 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFjWK-00011e-8h for importer@patchew.org; Thu, 25 Oct 2018 13:34:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFjKg-0006hl-1v for qemu-devel@nongnu.org; Thu, 25 Oct 2018 13:22:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gFjKc-0000MV-5f for qemu-devel@nongnu.org; Thu, 25 Oct 2018 13:22:03 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:37971) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gFjKb-0000C5-Oq for qemu-devel@nongnu.org; Thu, 25 Oct 2018 13:22:01 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id F1849221D0; Thu, 25 Oct 2018 13:21:16 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 25 Oct 2018 13:21:16 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 7B951E4ABC; Thu, 25 Oct 2018 13:21:16 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mesmtp; bh=FX7AVqrDwIhKrslQIwPg80IljEIEqJFqaXeTG0xChRA=; b=eTvsaBEq7GZm rSx7VwB2GLbuXz7Fzl7vbR9hxpChhbYBZu4HhEztReBDic5cV5FLDWe1SFZd8Qhu NXmd6WzG01HafJBe6xfEJrZEltpmLZR0pEMtSovo1nj1ZMMA68GZcg+E9vPz7jBy fRu10utzjVu/FJv7eaRZb3FBKatll6k= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=FX7AVqrDwIhKrslQIwPg80IljEIEqJFqaXeTG0xCh RA=; b=wcAretpwTb3wm6ZP/12jxG9sW34UeVBW0koPiO/+twKtFeTLgWeW8RX77 PtajlfeaD3f8zVEqmykPmDyIXuiFWJyBGv0ZgrG+8uwMpsfeP3nGQ83xAGu+jqpb BBgde2VuMcC+Wi+IMZp6AUhlLnXNX1/beG7lvPeLk4WY+seg8XdQctfb94XEAOkE h/t3I2ojOURsx9FNXoE2hbj954GOBu3UZI/viOow+qrBZyUpT2SEdgi8QN5ThAJ0 PnZBWdsvkvskw4t0R5Mz7KmrZa/lx/cxanN56fkz256h/PcI0kfJoD5Vmu/nmGUU H9W5KUwX3WaA/bPACKXQFqNV9TIAg== X-ME-Sender: X-ME-Proxy: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Thu, 25 Oct 2018 13:20:51 -0400 Message-Id: <20181025172057.20414-43-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025172057.20414-1-cota@braap.org> References: <20181025172057.20414-1-cota@braap.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.27 Subject: [Qemu-devel] [RFC 42/48] vl: support -plugin option X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Llu=C3=ADs=20Vilanova?= , Pavel Dovgalyuk , Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Llu=C3=ADs Vilanova Signed-off-by: Llu=C3=ADs Vilanova [ cota: s/instrument/plugin ] Signed-off-by: Emilio G. Cota --- vl.c | 11 +++++++++++ qemu-options.hx | 17 +++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/vl.c b/vl.c index 4e25c78bff..ebb188552e 100644 --- a/vl.c +++ b/vl.c @@ -111,6 +111,7 @@ int main(int argc, char **argv) =20 #include "trace-root.h" #include "trace/control.h" +#include "qemu/plugin.h" #include "qemu/queue.h" #include "sysemu/arch_init.h" =20 @@ -2962,6 +2963,7 @@ int main(int argc, char **argv, char **envp) } BlockdevOptions_queue; QSIMPLEQ_HEAD(, BlockdevOptions_queue) bdo_queue =3D QSIMPLEQ_HEAD_INITIALIZER(bdo_queue); + struct qemu_plugin_list plugin_list =3D QTAILQ_HEAD_INITIALIZER(plugin= _list); =20 module_call_init(MODULE_INIT_TRACE); =20 @@ -2990,6 +2992,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); @@ -3806,6 +3809,9 @@ int main(int argc, char **argv, char **envp) g_free(trace_file); trace_file =3D trace_opt_parse(optarg); break; + case QEMU_OPTION_plugin: + qemu_plugin_opt_parse(optarg, &plugin_list); + break; case QEMU_OPTION_readconfig: { int ret =3D qemu_read_config_file(optarg); @@ -4107,6 +4113,11 @@ int main(int argc, char **argv, char **envp) machine_class->default_machine_opts, 0); } =20 + /* process plugin before CPUs are created, but once -smp has been pars= ed */ + if (qemu_plugin_load_list(&plugin_list)) { + exit(1); + } + qemu_opts_foreach(qemu_find_opts("device"), default_driver_check, NULL, NULL); qemu_opts_foreach(qemu_find_opts("global"), diff --git a/qemu-options.hx b/qemu-options.hx index f139459e80..5cd1d84df4 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -3838,6 +3838,23 @@ HXCOMM HX does not support conditional compilation o= f text. @findex -trace @include qemu-option-trace.texi ETEXI +DEF("plugin", HAS_ARG, QEMU_OPTION_plugin, + "-plugin [file=3D][,arg=3D]\n" + " load a plugin\n", + QEMU_ARCH_ALL) +STEXI +@item -plugin file=3D@var{file}[,arg=3D@var{string}] +@findex -plugin + +Load a plugin. + +@table @option +@item file=3D@var{file} +Load the given plugin from a shared library file. +@item arg=3D@var{string} +Argument string passed to the plugin. (Can be given multiple times.) +@end table +ETEXI =20 HXCOMM Internal use DEF("qtest", HAS_ARG, QEMU_OPTION_qtest, "", QEMU_ARCH_ALL) --=20 2.17.1