mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
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>
This commit is contained in:
parent
1fff3c206f
commit
3c75e12ea6
6 changed files with 25 additions and 11 deletions
|
@ -658,6 +658,11 @@ static Object *object_new_with_type(Type type)
|
|||
return obj;
|
||||
}
|
||||
|
||||
Object *object_new_with_class(ObjectClass *klass)
|
||||
{
|
||||
return object_new_with_type(klass->type);
|
||||
}
|
||||
|
||||
Object *object_new(const char *typename)
|
||||
{
|
||||
TypeImpl *ti = type_get_by_name(typename);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue