forked from qemu/qemu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Pierrick Bouvier <[email protected]>
- Loading branch information
1 parent
3664083
commit 9c25021
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |