ObjectProperty member @type comes from object_property_try_add() / object_class_property_add() parameter @type. The former's function comment calls it "pretty loosely defined". This lack of discipline has turned out to be problematic. I'm replacing it step by step. query-command-line-options derives CommandLineParameterInfo member @type from it for class properties of machine types. Derive from @qapi_type instead, which is rigorously defined. The type of qemu-system-ppc64 machine parameter "cap-hpt-max-page-size" changes from "number" to "size", because @type is "int", whereas @qapi_type is &size_type_info. Small improvement. Signed-off-by: Markus Armbruster <armbru@redhat.com> --- util/qemu-config-qmp-cmds.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/util/qemu-config-qmp-cmds.c b/util/qemu-config-qmp-cmds.c index a680c9feca5..e0038628f97 100644 --- a/util/qemu-config-qmp-cmds.c +++ b/util/qemu-config-qmp-cmds.c @@ -98,16 +98,17 @@ static CommandLineParameterInfoList *get_drive_infolist(void) static CommandLineParameterInfo *objprop_to_cmdline_prop(ObjectProperty *prop) { + const QAPITypeInfo *qt = prop->qapi_type; CommandLineParameterInfo *info; info = g_malloc0(sizeof(*info)); info->name = g_strdup(prop->name); - if (g_str_equal(prop->type, "bool") || g_str_equal(prop->type, "OnOffAuto")) { + if (g_str_equal(qt->name, "bool") || g_str_equal(qt->name, "OnOffAuto")) { info->type = COMMAND_LINE_PARAMETER_TYPE_BOOLEAN; - } else if (g_str_equal(prop->type, "int")) { + } else if (g_str_equal(qt->name, "int")) { info->type = COMMAND_LINE_PARAMETER_TYPE_NUMBER; - } else if (g_str_equal(prop->type, "size")) { + } else if (g_str_equal(qt->name, "size")) { info->type = COMMAND_LINE_PARAMETER_TYPE_SIZE; } else { info->type = COMMAND_LINE_PARAMETER_TYPE_STRING; -- 2.55.0