diff options
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -2823,15 +2823,25 @@ static int object_set_property(const char *name, const char *value, void *opaque Object *obj = OBJECT(opaque); StringInputVisitor *siv; Error *local_err = NULL; + char *c, *qom_name; if (strcmp(name, "qom-type") == 0 || strcmp(name, "id") == 0 || strcmp(name, "type") == 0) { return 0; } + qom_name = g_strdup(name); + c = qom_name; + while (*c++) { + if (*c == '_') { + *c = '-'; + } + } + siv = string_input_visitor_new(value); - object_property_set(obj, string_input_get_visitor(siv), name, &local_err); + object_property_set(obj, string_input_get_visitor(siv), qom_name, &local_err); string_input_visitor_cleanup(siv); + g_free(qom_name); if (local_err) { qerror_report_err(local_err); |