diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2019-11-13 13:57:55 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-12-17 19:32:26 +0100 |
commit | 3c75e12ea64666f2fc9f822675490e8672f45453 (patch) | |
tree | c0b0a9e095782dd3014ac6544bd5e72e2fd38297 /target/s390x/cpu_models.c | |
parent | 1fff3c206f320104e929b22e6b9e82fc6e4c2ae6 (diff) |
qom: add object_new_with_class
Similar to CPU and machine classes, "-accel" class names are mangled,
so we have to first get a class via accel_find and then instantiate it.
Provide a new function to instantiate a class without going through
object_class_get_name, and use it for CPUs and machines already.
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target/s390x/cpu_models.c')
-rw-r--r-- | target/s390x/cpu_models.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 547bab8ac3..7c32180269 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -440,7 +440,7 @@ static void create_cpu_model_list(ObjectClass *klass, void *opaque) 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; @@ -498,7 +498,7 @@ static void cpu_model_from_info(S390CPUModel *model, const CpuModelInfo *info, 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) { |