Pranith Kumar <bobby.pr...@gmail.com> writes:
<snip> >> + >> +Plugin Life cycle >> +================= >> + >> +First the plugin is loaded and the public qemu_plugin_install function >> +is called. The plugin with then register callbacks for various plugin > > s/with/will/ > >> +events. Generally at least the atexit_cb is registered so the plugin >> +can dump its information at the end of a run. > > Is that a hard requirement? Not really although for a lot of plugins it is a natural point to dump the results of the experiment. <snip> >> + >> +As a result registering/unregistering callbacks is "slow", since it >> +takes a lock. But this is very infrequent; we want performance when >> +calling (or not calling) callbacks, not when registering them. Using >> +RCU is great for this. >> + >> +We support the uninstallation of a plugin at any time (e.g. from plugin >> +callbacks). This means some callbacks might still be called after the >> uninstall >> +function returns. The plugin isn't completely uninstalled until the >> +safe work has executed while all vCPUs are quiescent. > > Isn't this when the atexit callback is invoked? Might add that to make > it clearer. No we can uninstall at any time, I've amended to: We support the uninstallation of a plugin at any time (e.g. from plugin callbacks). This allows plugins to remove themselves if they no longer want to instrument the code. This operation is asynchronous which means callbacks may still occur after the uninstall operation is requested. The plugin isn't completely uninstalled until the safe work has executed while all vCPUs are quiescent. -- Alex Bennée