diff options
-rw-r--r-- | qapi/opts-visitor.c | 2 | ||||
-rw-r--r-- | tests/test-opts-visitor.c | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c index 1048bbc84e..1453cf6de0 100644 --- a/qapi/opts-visitor.c +++ b/qapi/opts-visitor.c @@ -164,7 +164,7 @@ opts_check_struct(Visitor *v, Error **errp) GHashTableIter iter; GQueue *any; - if (ov->depth > 0) { + if (ov->depth > 1) { return; } diff --git a/tests/test-opts-visitor.c b/tests/test-opts-visitor.c index 8befe82918..2886a722e4 100644 --- a/tests/test-opts-visitor.c +++ b/tests/test-opts-visitor.c @@ -175,6 +175,7 @@ expect_u64_max(OptsVisitorFixture *f, gconstpointer test_data) static void test_opts_dict_unvisited(void) { + Error *err = NULL; QemuOpts *opts; Visitor *v; UserDefOptions *userdef; @@ -183,11 +184,11 @@ test_opts_dict_unvisited(void) &error_abort); v = opts_visitor_new(opts); - /* BUG: bogus should be diagnosed */ - visit_type_UserDefOptions(v, NULL, &userdef, &error_abort); + visit_type_UserDefOptions(v, NULL, &userdef, &err); + error_free_or_abort(&err); visit_free(v); qemu_opts_del(opts); - qapi_free_UserDefOptions(userdef); + g_assert(!userdef); } int |