aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2019-07-22 17:10:46 +0400
committerPaolo Bonzini <pbonzini@redhat.com>2019-08-21 16:29:57 +0200
commit90629122d2ef536290882c71ca16bac3df842ca1 (patch)
tree51a023f2ecd1ddea03b892049ddfcc6e78820824 /util
parentc932ce3144d92b3032336d02b59e6a14be68098d (diff)
module: use g_hash_table_add()
The hashtable is used like a set, use the convenience g_hash_table_add() function. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'util')
-rw-r--r--util/module.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/util/module.c b/util/module.c
index 142db7e911..ca9885c490 100644
--- a/util/module.c
+++ b/util/module.c
@@ -179,11 +179,10 @@ void module_load_one(const char *prefix, const char *lib_name)
module_name = g_strdup_printf("%s%s", prefix, lib_name);
- if (g_hash_table_lookup(loaded_modules, module_name)) {
+ if (!g_hash_table_add(loaded_modules, module_name)) {
g_free(module_name);
return;
}
- g_hash_table_insert(loaded_modules, module_name, module_name);
exec_dir = qemu_get_exec_dir();
search_dir = getenv("QEMU_MODULE_DIR");