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>
This commit is contained in:
Paolo Bonzini 2019-11-13 14:03:46 +01:00
parent 3c75e12ea6
commit fc5cf82621
3 changed files with 6 additions and 4 deletions

View file

@ -46,9 +46,9 @@ AccelClass *accel_find(const char *opt_name)
return ac;
}
int accel_init_machine(AccelClass *acc, MachineState *ms)
int accel_init_machine(AccelState *accel, MachineState *ms)
{
AccelState *accel = ACCEL(object_new_with_class(OBJECT_CLASS(acc)));
AccelClass *acc = ACCEL_GET_CLASS(accel);
int ret;
ms->accelerator = accel;
*(acc->allowed) = true;