Skip to content

Commit

Permalink
test plugins_fix_reset
Browse files Browse the repository at this point in the history
Signed-off-by: Pierrick Bouvier <[email protected]>
  • Loading branch information
pbo-linaro committed Oct 16, 2024
1 parent 3664083 commit 9c25021
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/plugins/meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
t = []
if get_option('plugins')
foreach i : ['cache', 'drcov', 'execlog', 'hotblocks', 'hotpages', 'howvec',
'hwprofile', 'ips', 'lockstep', 'stoptrigger']
'hwprofile', 'ips', 'lockstep', 'stoptrigger', 'min']
if host_os == 'windows'
t += shared_module(i, files(i + '.c') + 'win32_linker.c',
include_directories: '../../include/qemu',
Expand Down
26 changes: 26 additions & 0 deletions contrib/plugins/min.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include <stdio.h>
#include <qemu-plugin.h>

QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION;

qemu_plugin_id_t plugin_id = {0};

static void post_reset(qemu_plugin_id_t id)
{
printf("Reset finished\n");
}

static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb)
{
printf("Translating basic block\n");
qemu_plugin_reset(plugin_id, post_reset);
printf("Reset request issued\n");
}

QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id,
const qemu_info_t *info, int argc, char **argv) {

qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans);
plugin_id = id;
return 0;
}

0 comments on commit 9c25021

Please sign in to comment.