From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXrbX-0003dd-Vo for qemu-devel@nongnu.org; Fri, 14 Dec 2018 12:50:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXrbU-0005bZ-Qm for qemu-devel@nongnu.org; Fri, 14 Dec 2018 12:50:27 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:36735) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXrbU-0005bH-IO for qemu-devel@nongnu.org; Fri, 14 Dec 2018 12:50:24 -0500 Date: Fri, 14 Dec 2018 12:50:22 -0500 From: "Emilio G. Cota" Message-ID: <20181214175022.GA18314@flamenco> References: <20181209193749.12277-1-cota@braap.org> <20181209193749.12277-6-cota@braap.org> <20181214155724.GB4314@quinoa.localdomain> <20181214170822.GA15965@flamenco> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181214170822.GA15965@flamenco> Subject: Re: [Qemu-devel] [RFC v2 05/38] plugin: add user-facing API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aaron Lindsay Cc: Alex =?iso-8859-1?Q?Benn=E9e?= , Richard Henderson , "qemu-devel@nongnu.org" , Pavel Dovgalyuk On Fri, Dec 14, 2018 at 12:08:22 -0500, Emilio G. Cota wrote: > On Fri, Dec 14, 2018 at 15:57:32 +0000, Aaron Lindsay wrote: (snip) > > I added a function to the user-facing plugin API in my own version of > > Pavel's plugin patchset to clear all existing plugin instrumentation, (snip) > I think the following API call would do what you need: > > typedef int (*qemu_plugin_reset_cb_t)(qemu_plugin_id_t id); > void qemu_plugin_reset(qemu_plugin_id_t id, qemu_plugin_reset_cb_t cb); > > (or maybe qemu_plugin_reinstall?) An alternative is to track the TBs that a plugin has inserted instrumentation into, and only flush those. This would require us to do an additional hash table insert when adding a direct callback, but it allow us to avoid exporting tb_flush indirectly to plugins, which could be abused by malicious plugins to perform a DoS attack. I'll look into this. E.