Lines Matching +full:async +full:- +full:enum
13 * See the COPYING file in the top-level directory.
15 * SPDX-License-Identifier: GPL-2.0-or-later
19 #include "qemu/error-report.h"
20 #include "qemu/config-file.h"
32 #include "qemu/target-info.h"
33 #include "exec/tb-flush.h"
84 if (strcmp(desc->path, path) == 0) { in plugin_find_desc()
106 error_setg(errp, "requires a non-empty argument"); in plugin_add()
109 p = plugin_find_desc(arg->head, value); in plugin_add()
112 p->path = g_strdup(value); in plugin_add()
113 QTAILQ_INSERT_TAIL(arg->head, p, entry); in plugin_add()
115 arg->curr = p; in plugin_add()
117 if (arg->curr == NULL) { in plugin_add()
118 error_setg(errp, "missing earlier '-plugin file=' option"); in plugin_add()
136 p = arg->curr; in plugin_add()
137 p->argc++; in plugin_add()
138 p->argv = g_realloc_n(p->argv, p->argc, sizeof(char *)); in plugin_add()
139 p->argv[p->argc - 1] = fullarg; in plugin_add()
188 ctx->desc = desc; in plugin_load()
190 ctx->handle = g_module_open(desc->path, G_MODULE_BIND_LOCAL); in plugin_load()
191 if (ctx->handle == NULL) { in plugin_load()
192 error_setg(errp, "Could not load plugin %s: %s", desc->path, g_module_error()); in plugin_load()
196 if (!g_module_symbol(ctx->handle, "qemu_plugin_install", &sym)) { in plugin_load()
197 error_setg(errp, "Could not load plugin %s: %s", desc->path, g_module_error()); in plugin_load()
204 desc->path); in plugin_load()
208 if (!g_module_symbol(ctx->handle, "qemu_plugin_version", &sym)) { in plugin_load()
210 desc->path, g_module_error()); in plugin_load()
217 desc->path, version, QEMU_PLUGIN_MIN_VERSION); in plugin_load()
222 desc->path, version, QEMU_PLUGIN_VERSION); in plugin_load()
230 ctx->id = (uint64_t)(uintptr_t)ctx; in plugin_load()
234 ctx->id = xorshift64star(ctx->id); in plugin_load()
235 existing = g_hash_table_lookup(plugin.id_ht, &ctx->id); in plugin_load()
239 success = g_hash_table_insert(plugin.id_ht, &ctx->id, &ctx->id); in plugin_load()
245 ctx->installing = true; in plugin_load()
246 rc = install(ctx->id, info, desc->argc, desc->argv); in plugin_load()
247 ctx->installing = false; in plugin_load()
250 desc->path, rc); in plugin_load()
255 if (!ctx->uninstalling) { in plugin_load()
256 plugin_reset_uninstall(ctx->id, NULL, false); in plugin_load()
264 g_module_close(ctx->handle); in plugin_load()
275 for (i = 0; i < desc->argc; i++) { in plugin_desc_free()
276 g_free(desc->argv[i]); in plugin_desc_free()
278 g_free(desc->argv); in plugin_desc_free()
279 g_free(desc->path); in plugin_desc_free()
284 * qemu_plugin_load_list - load a list of plugins
297 info->target_name = target_name(); in qemu_plugin_load_list()
298 info->version.min = QEMU_PLUGIN_MIN_VERSION; in qemu_plugin_load_list()
299 info->version.cur = QEMU_PLUGIN_VERSION; in qemu_plugin_load_list()
323 struct qemu_plugin_ctx *ctx = data->ctx; in plugin_reset_destroy__locked()
324 enum qemu_plugin_event ev; in plugin_reset_destroy__locked()
329 * grace period to elapse, because right now we either are in a "safe async" in plugin_reset_destroy__locked()
337 if (data->reset) { in plugin_reset_destroy__locked()
338 g_assert(ctx->resetting); in plugin_reset_destroy__locked()
339 if (data->cb) { in plugin_reset_destroy__locked()
340 data->cb(ctx->id); in plugin_reset_destroy__locked()
342 ctx->resetting = false; in plugin_reset_destroy__locked()
347 g_assert(ctx->uninstalling); in plugin_reset_destroy__locked()
349 if (ctx->installing) { in plugin_reset_destroy__locked()
355 success = g_hash_table_remove(plugin.id_ht, &ctx->id); in plugin_reset_destroy__locked()
358 if (data->cb) { in plugin_reset_destroy__locked()
359 data->cb(ctx->id); in plugin_reset_destroy__locked()
361 if (!g_module_close(ctx->handle)) { in plugin_reset_destroy__locked()
364 plugin_desc_free(ctx->desc); in plugin_reset_destroy__locked()
394 if (ctx->uninstalling || (reset && ctx->resetting)) { in plugin_reset_uninstall()
397 ctx->resetting = reset; in plugin_reset_uninstall()
398 ctx->uninstalling = !reset; in plugin_reset_uninstall()
402 data->ctx = ctx; in plugin_reset_uninstall()
403 data->cb = cb; in plugin_reset_uninstall()
404 data->reset = reset; in plugin_reset_uninstall()
407 * current_cpu must be non-NULL. in plugin_reset_uninstall()