diff options
| author | Paolo Bonzini | 2019-11-13 13:57:55 +0100 |
|---|---|---|
| committer | Paolo Bonzini | 2019-12-17 19:32:26 +0100 |
| commit | 3c75e12ea64666f2fc9f822675490e8672f45453 (patch) | |
| tree | c0b0a9e095782dd3014ac6544bd5e72e2fd38297 /qom | |
| parent | qom: introduce object_register_sugar_prop (diff) | |
| download | qemu-3c75e12ea64666f2fc9f822675490e8672f45453.tar.gz qemu-3c75e12ea64666f2fc9f822675490e8672f45453.tar.xz qemu-3c75e12ea64666f2fc9f822675490e8672f45453.zip | |
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 'qom')
| -rw-r--r-- | qom/object.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/qom/object.c b/qom/object.c index e7b72f7d55..0d971ca897 100644 --- a/qom/object.c +++ b/qom/object.c @@ -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); |
