From 3c75e12ea64666f2fc9f822675490e8672f45453 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 13 Nov 2019 13:57:55 +0100 Subject: qom: add object_new_with_class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Paolo Bonzini --- vl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'vl.c') diff --git a/vl.c b/vl.c index b95c161..65e6b75 100644 --- a/vl.c +++ b/vl.c @@ -3834,8 +3834,7 @@ int main(int argc, char **argv, char **envp) cleanup_add_fd, NULL, &error_fatal); #endif - current_machine = MACHINE(object_new(object_class_get_name( - OBJECT_CLASS(machine_class)))); + current_machine = MACHINE(object_new_with_class(OBJECT_CLASS(machine_class))); if (machine_help_func(qemu_get_machine_opts(), current_machine)) { exit(0); } -- cgit v1.1