diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2019-11-13 14:03:46 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-12-17 19:32:27 +0100 |
commit | fc5cf8262113e80d35177f06d49bcc1a9d3dc9fc (patch) | |
tree | ec88d5dc2e1bf2b328a45e8daa80fd6207afd7e4 /vl.c | |
parent | 3c75e12ea64666f2fc9f822675490e8672f45453 (diff) |
accel: pass object to accel_init_machine
We will have to set QOM properties before accel_init_machine, based on the
options provided to -accel. Construct the object outside it so that it
will be possible to iterate on properties between object_new_with_class
and accel_init_machine.
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -2716,6 +2716,7 @@ static int do_configure_accelerator(void *opaque, QemuOpts *opts, Error **errp) bool *p_init_failed = opaque; const char *acc = qemu_opt_get(opts, "accel"); AccelClass *ac = accel_find(acc); + AccelState *accel; int ret; if (!ac) { @@ -2723,7 +2724,8 @@ static int do_configure_accelerator(void *opaque, QemuOpts *opts, Error **errp) error_report("invalid accelerator %s", acc); return 0; } - ret = accel_init_machine(ac, current_machine); + accel = ACCEL(object_new_with_class(OBJECT_CLASS(ac))); + ret = accel_init_machine(accel, current_machine); if (ret < 0) { *p_init_failed = true; error_report("failed to initialize %s: %s", |