diff options
Diffstat (limited to 'qapi/opts-visitor.c')
-rw-r--r-- | qapi/opts-visitor.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c index d54f75b5e7..ae5b9553fa 100644 --- a/qapi/opts-visitor.c +++ b/qapi/opts-visitor.c @@ -157,17 +157,11 @@ opts_start_struct(Visitor *v, const char *name, void **obj, } -static gboolean -ghr_true(gpointer ign_key, gpointer ign_value, gpointer ign_user_data) -{ - return TRUE; -} - - static void opts_end_struct(Visitor *v, Error **errp) { OptsVisitor *ov = to_ov(v); + GHashTableIter iter; GQueue *any; if (--ov->depth > 0) { @@ -175,8 +169,8 @@ opts_end_struct(Visitor *v, Error **errp) } /* we should have processed all (distinct) QemuOpt instances */ - any = g_hash_table_find(ov->unprocessed_opts, &ghr_true, NULL); - if (any) { + g_hash_table_iter_init(&iter, ov->unprocessed_opts); + if (g_hash_table_iter_next(&iter, NULL, (void **)&any)) { const QemuOpt *first; first = g_queue_peek_head(any); |