On 22/01/21 15:14, Markus Armbruster wrote:
+    dobj = 
DUMMY_OBJECT(object_resolve_path_component(object_get_objects_root(),
+                                                      "dev0"));
Why does user_creatable_add_opts() return the object on success, null on
failure, but user_creatable_add_dict() only a rather less useful bool?

I would guess that nobody needs it outside tests (I didn't look at the code).

      g_assert(dobj);
      g_assert_cmpstr(dobj->sv, ==, "Hiss hiss hiss");
      g_assert(dobj->bv == true);
      g_assert(dobj->av == DUMMY_PLATYPUS);
+ qdict = keyval_parse(params, "qom-type", &help, &err);

Why parse again?

Besides the justification of the previous email, user_creatable_add_dict modifies its QDict argument, removing the "qom-type" and "id" keys. Wart fixed in patch 16.

Paolo


Reply via email to