handle some errors properly so avoid exit() during initialization. this fixes issue #237
This commit is contained in:
@@ -17,10 +17,12 @@
|
||||
#include "exec/address-spaces.h"
|
||||
|
||||
|
||||
static void tosa_init(struct uc_struct *uc, MachineState *machine)
|
||||
static int tosa_init(struct uc_struct *uc, MachineState *machine)
|
||||
{
|
||||
//cpu_arm_init(uc, "pxa255");
|
||||
cpu_arm_init(uc, "cortex-a15"); // FIXME
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void tosa_machine_init(struct uc_struct *uc)
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "exec/address-spaces.h"
|
||||
|
||||
|
||||
static void machvirt_init(struct uc_struct *uc, MachineState *machine)
|
||||
static int machvirt_init(struct uc_struct *uc, MachineState *machine)
|
||||
{
|
||||
const char *cpu_model = machine->cpu_model;
|
||||
int n;
|
||||
@@ -51,12 +51,14 @@ static void machvirt_init(struct uc_struct *uc, MachineState *machine)
|
||||
|
||||
if (!oc) {
|
||||
fprintf(stderr, "Unable to find CPU definition\n");
|
||||
exit(1);
|
||||
return -1;
|
||||
}
|
||||
|
||||
cpuobj = object_new(uc, object_class_get_name(oc));
|
||||
object_property_set_bool(uc, cpuobj, true, "realized", NULL);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void machvirt_machine_init(struct uc_struct *uc)
|
||||
|
||||
Reference in New Issue
Block a user