if (cpu_list_data->model) {
Object *obj;
S390CPU *sc;
- obj = object_new(object_class_get_name(klass));
+ obj = object_new_with_class(klass);
sc = S390_CPU(obj);
if (sc->model) {
info->has_unavailable_features = true;
error_setg(errp, "The CPU definition '%s' requires KVM", info->name);
return;
}
- obj = object_new(object_class_get_name(oc));
+ obj = object_new_with_class(oc);
cpu = S390_CPU(obj);
if (!cpu->model) {
if (qdict) {
visitor = qobject_input_visitor_new(info->props);
- visit_start_struct(visitor, NULL, NULL, 0, &err);
- if (err) {
+ if (!visit_start_struct(visitor, NULL, NULL, 0, &err)) {
error_propagate(errp, err);
visit_free(visitor);
object_unref(obj);
return;
}
for (e = qdict_first(qdict); e; e = qdict_next(qdict, e)) {
- object_property_set(obj, visitor, e->key, &err);
+ object_property_set(obj, e->key, visitor, &err);
if (err) {
break;
}
}
if (!err) {
- visit_check_struct(visitor, errp);
+ visit_check_struct(visitor, &err);
}
visit_end_struct(visitor, NULL);
visit_free(visitor);
return;
}
- visit_type_bool(v, name, &value, &err);
- if (err) {
+ if (!visit_type_bool(v, name, &value, &err)) {
error_propagate(errp, err);
return;
}
return;
}
- visit_type_bool(v, name, &value, &err);
- if (err) {
+ if (!visit_type_bool(v, name, &value, &err)) {
error_propagate(errp, err);
return;
}
for (feat = 0; feat < S390_FEAT_MAX; feat++) {
const S390FeatDef *def = s390_feat_def(feat);
object_property_add(obj, def->name, "bool", get_feature,
- set_feature, NULL, (void *) feat, NULL);
- object_property_set_description(obj, def->name, def->desc , NULL);
+ set_feature, NULL, (void *) feat);
+ object_property_set_description(obj, def->name, def->desc);
}
for (group = 0; group < S390_FEAT_GROUP_MAX; group++) {
const S390FeatGroupDef *def = s390_feat_group_def(group);
object_property_add(obj, def->name, "bool", get_feature_group,
- set_feature_group, NULL, (void *) group, NULL);
- object_property_set_description(obj, def->name, def->desc , NULL);
+ set_feature_group, NULL, (void *) group);
+ object_property_set_description(obj, def->name, def->desc);
}
}
void s390_cpu_model_class_register_props(ObjectClass *oc)
{
object_class_property_add_bool(oc, "migration-safe", get_is_migration_safe,
- NULL, NULL);
+ NULL);
object_class_property_add_bool(oc, "static", get_is_static,
- NULL, NULL);
- object_class_property_add_str(oc, "description", get_description, NULL,
- NULL);
+ NULL);
+ object_class_property_add_str(oc, "description", get_description, NULL);
}
#ifdef CONFIG_KVM