f80f9ec changed the order that machines are registered which had the effect of
changing the default machine. This changeset introduces a new is_default field
so that machine types can declare that they are the default for an architecture.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
QEMUMachineInitFunc *init;
int use_scsi;
int max_cpus;
+ int is_default;
struct QEMUMachine *next;
} QEMUMachine;
int qemu_register_machine(QEMUMachine *m);
-void register_machines(void);
extern QEMUMachine *current_machine;
.name = "bareetraxfs",
.desc = "Bare ETRAX FS board",
.init = bareetraxfs_init,
+ .is_default = 1,
};
static void bareetraxfs_machine_init(void)
.name = "integratorcp",
.desc = "ARM Integrator/CP (ARM926EJ-S)",
.init = integratorcp_init,
+ .is_default = 1,
};
static void integratorcp_machine_init(void)
.name = "mcf5208evb",
.desc = "MCF5206EVB",
.init = mcf5208evb_init,
+ .is_default = 1,
};
static void mcf5208evb_machine_init(void)
.name = "malta",
.desc = "MIPS Malta Core LV",
.init = mips_malta_init,
+ .is_default = 1,
};
static void mips_malta_machine_init(void)
.desc = "Standard PC",
.init = pc_init_pci,
.max_cpus = 255,
+ .is_default = 1,
};
static QEMUMachine isapc_machine = {
.desc = "Heathrow based PowerMAC",
.init = ppc_heathrow_init,
.max_cpus = MAX_CPUS,
+ .is_default = 1,
};
static void heathrow_machine_init(void)
.name = "shix",
.desc = "shix card",
.init = shix_init,
+ .is_default = 1,
};
static void shix_machine_init(void)
.desc = "Sun4m platform, SPARCstation 5",
.init = ss5_init,
.use_scsi = 1,
+ .is_default = 1,
};
static QEMUMachine ss10_machine = {
.desc = "Sun4u platform",
.init = sun4u_init,
.max_cpus = 1, // XXX for now
+ .is_default = 1,
};
static QEMUMachine sun4v_machine = {
return NULL;
}
+static QEMUMachine *find_default_machine(void)
+{
+ QEMUMachine *m;
+
+ for(m = first_machine; m != NULL; m = m->next) {
+ if (m->is_default) {
+ return m;
+ }
+ }
+ return NULL;
+}
+
/***********************************************************/
/* main execution loop */
#endif
module_call_init(MODULE_INIT_MACHINE);
- machine = first_machine;
+ machine = find_default_machine();
cpu_model = NULL;
initrd_filename = NULL;
ram_size = 0;
for(m = first_machine; m != NULL; m = m->next) {
printf("%-10s %s%s\n",
m->name, m->desc,
- m == first_machine ? " (default)" : "");
+ m->is_default ? " (default)" : "");
}
exit(*optarg != '?');
}