aboutsummaryrefslogtreecommitdiff
path: root/accel.c
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2014-09-26 17:45:29 -0300
committerPaolo Bonzini <pbonzini@redhat.com>2014-10-04 08:59:16 +0200
commit0d15da8e6fc3cbcd088476c561dcc88b9aae493a (patch)
tree562e5ca31930e9ed9383199f333ac429576e6469 /accel.c
parentd95c8527e9662a54a8f98c2ced35736604b1b253 (diff)
accel: Rename 'init' method to 'init_machine'
Today, all accelerator init functions affect some global state: * tcg_init() calls tcg_exec_init() and affects globals such as tcg_tcx, page size globals, and possibly others; * kvm_init() changes the kvm_state global, cpu_interrupt_handler, and possibly others; * xen_init() changes the xen_xc global, and registers a change state handler. With the new accelerator QOM classes, initialization may now be split in two steps: * instance_init() will do basic initialization that doesn't affect any global state and don't need MachineState or MachineClass data. This will allow probing code to safely create multiple accelerator objects on the fly just for reporting host/accelerator capabilities, for example. * accel_init_machine()/init_machine() will save the accelerator object in MachineState, and do initialization steps which still affect global state, machine state, or that need data from MachineClass or MachineState. To clarify the difference between those two steps, rename init() to init_machine(). Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'accel.c')
-rw-r--r--accel.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/accel.c b/accel.c
index 9241967cad..b151d558a5 100644
--- a/accel.c
+++ b/accel.c
@@ -57,11 +57,11 @@ static AccelClass *accel_find(const char *opt_name)
return ac;
}
-static int accel_init(AccelClass *acc, MachineClass *mc)
+static int accel_init_machine(AccelClass *acc, MachineClass *mc)
{
int ret;
*(acc->allowed) = true;
- ret = acc->init(mc);
+ ret = acc->init_machine(mc);
if (ret < 0) {
*(acc->allowed) = false;
}
@@ -98,7 +98,7 @@ int configure_accelerator(MachineClass *mc)
acc->name);
continue;
}
- ret = accel_init(acc, mc);
+ ret = accel_init_machine(acc, mc);
if (ret < 0) {
init_failed = true;
fprintf(stderr, "failed to initialize %s: %s\n",
@@ -128,7 +128,7 @@ static void tcg_accel_class_init(ObjectClass *oc, void *data)
{
AccelClass *ac = ACCEL_CLASS(oc);
ac->name = "tcg";
- ac->init = tcg_init;
+ ac->init_machine = tcg_init;
ac->allowed = &tcg_allowed;
}