提交 0c257437 编写于 作者: A Anthony Liguori

Introduce is_default field for QEMUMachine

f80f9ec9 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: NAnthony Liguori <aliguori@us.ibm.com>
上级 993fbfdb
master openEuler-20.03-LTS openEuler-20.09 openEuler-RISCV stable-0.11 stable-0.12 stable-0.13 stable-0.14 stable-0.15 stable-1.0 stable-1.1 stable-1.2 stable-1.3 stable-1.4 stable-1.5 stable-1.6 stable-1.7 stable-2.0 stable-2.1 stable-2.10 stable-2.11 stable-2.12 stable-2.2 stable-2.3 stable-2.4 stable-2.5 stable-2.6 stable-2.7 stable-2.8 stable-2.9 stable-3.0 stable-3.1 stable-4.0 stable-4.1 stable-4.2 staging v5.1.0-rc2 v5.1.0-rc1 v5.1.0-rc0 v5.0.0 v5.0.0-rc4 v5.0.0-rc3 v5.0.0-rc2 v5.0.0-rc1 v5.0.0-rc0 v4.2.1 v4.2.0 v4.2.0-rc5 v4.2.0-rc4 v4.2.0-rc3 v4.2.0-rc2 v4.2.0-rc1 v4.2.0-rc0 v4.1.1 v4.1.0 v4.1.0-rc5 v4.1.0-rc4 v4.1.0-rc3 v4.1.0-rc2 v4.1.0-rc1 v4.1.0-rc0 v4.0.1 v4.0.0 v4.0.0-rc4 v4.0.0-rc3 v4.0.0-rc2 v4.0.0-rc1 v4.0.0-rc0 v3.1.1.1 v3.1.1 v3.1.0 v3.1.0-rc5 v3.1.0-rc4 v3.1.0-rc3 v3.1.0-rc2 v3.1.0-rc1 v3.1.0-rc0 v3.0.1 v3.0.0 v3.0.0-rc4 v3.0.0-rc3 v3.0.0-rc2 v3.0.0-rc1 v3.0.0-rc0 v2.12.1 v2.12.0 v2.12.0-rc4 v2.12.0-rc3 v2.12.0-rc2 v2.12.0-rc1 v2.12.0-rc0 v2.11.2 v2.11.1 v2.11.0 v2.11.0-rc5 v2.11.0-rc4 v2.11.0-rc3 v2.11.0-rc2 v2.11.0-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.0 v1.5.0-rc3 v1.5.0-rc2 v1.5.0-rc1 v1.5.0-rc0 v1.4.2 v1.4.1 v1.4.0 v1.4.0-rc2 v1.4.0-rc1 v1.4.0-rc0 v1.3.1 v1.3.0 v1.3.0-rc2 v1.3.0-rc1 v1.3.0-rc0 v1.2.2 v1.2.1 v1.2.0 v1.2.0-rc3 v1.2.0-rc2 v1.2.0-rc1 v1.2.0-rc0 v1.1.2 v1.1.1 v1.1.0 v1.1.0-rc4 v1.1.0-rc3 v1.1.0-rc2 v1.1-rc2 v1.1-rc1 v1.1-rc0 v1.0.1 v1.0 v1.0-rc4 v1.0-rc3 v1.0-rc2 v1.0-rc1 v1.0-rc0 v0.15.1 v0.15.0 v0.15.0-rc2 v0.15.0-rc1 v0.15.0-rc0 v0.14.1 v0.14.0 v0.14.0-rc2 v0.14.0-rc1 v0.14.0-rc0 v0.13.0 v0.13.0-rc3 v0.13.0-rc2 v0.13.0-rc1 v0.13.0-rc0 v0.12.5 v0.12.4 v0.12.3 v0.12.2 v0.12.1 v0.12.0 v0.12.0-rc2 v0.12.0-rc1 v0.12.0-rc0 v0.11.1 v0.11.0 v0.11.0-rc2 v0.11.0-rc1 v0.11.0-rc0
无相关合并请求
......@@ -16,11 +16,11 @@ typedef struct QEMUMachine {
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;
......
......@@ -162,6 +162,7 @@ static QEMUMachine bareetraxfs_machine = {
.name = "bareetraxfs",
.desc = "Bare ETRAX FS board",
.init = bareetraxfs_init,
.is_default = 1,
};
static void bareetraxfs_machine_init(void)
......
......@@ -512,6 +512,7 @@ static QEMUMachine integratorcp_machine = {
.name = "integratorcp",
.desc = "ARM Integrator/CP (ARM926EJ-S)",
.init = integratorcp_init,
.is_default = 1,
};
static void integratorcp_machine_init(void)
......
......@@ -290,6 +290,7 @@ static QEMUMachine mcf5208evb_machine = {
.name = "mcf5208evb",
.desc = "MCF5206EVB",
.init = mcf5208evb_init,
.is_default = 1,
};
static void mcf5208evb_machine_init(void)
......
......@@ -953,6 +953,7 @@ static QEMUMachine mips_malta_machine = {
.name = "malta",
.desc = "MIPS Malta Core LV",
.init = mips_malta_init,
.is_default = 1,
};
static void mips_malta_machine_init(void)
......
......@@ -1189,6 +1189,7 @@ static QEMUMachine pc_machine = {
.desc = "Standard PC",
.init = pc_init_pci,
.max_cpus = 255,
.is_default = 1,
};
static QEMUMachine isapc_machine = {
......
......@@ -386,6 +386,7 @@ static QEMUMachine heathrow_machine = {
.desc = "Heathrow based PowerMAC",
.init = ppc_heathrow_init,
.max_cpus = MAX_CPUS,
.is_default = 1,
};
static void heathrow_machine_init(void)
......
......@@ -92,6 +92,7 @@ static QEMUMachine shix_machine = {
.name = "shix",
.desc = "shix card",
.init = shix_init,
.is_default = 1,
};
static void shix_machine_init(void)
......
......@@ -1037,6 +1037,7 @@ static QEMUMachine ss5_machine = {
.desc = "Sun4m platform, SPARCstation 5",
.init = ss5_init,
.use_scsi = 1,
.is_default = 1,
};
static QEMUMachine ss10_machine = {
......
......@@ -594,6 +594,7 @@ static QEMUMachine sun4u_machine = {
.desc = "Sun4u platform",
.init = sun4u_init,
.max_cpus = 1, // XXX for now
.is_default = 1,
};
static QEMUMachine sun4v_machine = {
......
......@@ -3497,6 +3497,18 @@ static QEMUMachine *find_machine(const char *name)
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 */
......@@ -4876,7 +4888,7 @@ int main(int argc, char **argv, char **envp)
#endif
module_call_init(MODULE_INIT_MACHINE);
machine = first_machine;
machine = find_default_machine();
cpu_model = NULL;
initrd_filename = NULL;
ram_size = 0;
......@@ -4967,7 +4979,7 @@ int main(int argc, char **argv, char **envp)
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 != '?');
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部