hotblocks.c (9c03aa87e52567f6c9a7bf456e5dd94dc84088de) hotblocks.c (402587419993d86638f1f81fc4e55625a320ad2f)
1/*
2 * Copyright (C) 2019, Alex Bennée <alex.bennee@linaro.org>
3 *
4 * License: GNU GPL, version 2 or later.
5 * See the COPYING file in the top-level directory.
6 */
7#include <inttypes.h>
8#include <assert.h>

--- 121 unchanged lines hidden (view full) ---

130}
131
132QEMU_PLUGIN_EXPORT
133int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info,
134 int argc, char **argv)
135{
136 for (int i = 0; i < argc; i++) {
137 char *opt = argv[i];
1/*
2 * Copyright (C) 2019, Alex Bennée <alex.bennee@linaro.org>
3 *
4 * License: GNU GPL, version 2 or later.
5 * See the COPYING file in the top-level directory.
6 */
7#include <inttypes.h>
8#include <assert.h>

--- 121 unchanged lines hidden (view full) ---

130}
131
132QEMU_PLUGIN_EXPORT
133int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info,
134 int argc, char **argv)
135{
136 for (int i = 0; i < argc; i++) {
137 char *opt = argv[i];
138 g_autofree char **tokens = g_strsplit(opt, "=", 2);
138 g_auto(GStrv) tokens = g_strsplit(opt, "=", 2);
139 if (g_strcmp0(tokens[0], "inline") == 0) {
140 if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_inline)) {
141 fprintf(stderr, "boolean argument parsing failed: %s\n", opt);
142 return -1;
143 }
144 } else {
145 fprintf(stderr, "option parsing failed: %s\n", opt);
146 return -1;
147 }
148 }
149
150 plugin_init();
151
152 qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans);
153 qemu_plugin_register_atexit_cb(id, plugin_exit, NULL);
154 return 0;
155}
139 if (g_strcmp0(tokens[0], "inline") == 0) {
140 if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_inline)) {
141 fprintf(stderr, "boolean argument parsing failed: %s\n", opt);
142 return -1;
143 }
144 } else {
145 fprintf(stderr, "option parsing failed: %s\n", opt);
146 return -1;
147 }
148 }
149
150 plugin_init();
151
152 qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans);
153 qemu_plugin_register_atexit_cb(id, plugin_exit, NULL);
154 return 0;
155}