diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2009-05-21 20:41:01 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-05-21 20:54:40 -0500 |
commit | 0c257437b25731d4f44985e4b30b7317f2845b4a (patch) | |
tree | 36ab639f617589370e583bd774c16a14d5eb73b4 | |
parent | 993fbfdb1b1a8d9b3d32ed57afc70a7be1a5e9dc (diff) |
Introduce is_default field for QEMUMachine
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>
-rw-r--r-- | hw/boards.h | 2 | ||||
-rw-r--r-- | hw/etraxfs.c | 1 | ||||
-rw-r--r-- | hw/integratorcp.c | 1 | ||||
-rw-r--r-- | hw/mcf5208.c | 1 | ||||
-rw-r--r-- | hw/mips_malta.c | 1 | ||||
-rw-r--r-- | hw/pc.c | 1 | ||||
-rw-r--r-- | hw/ppc_oldworld.c | 1 | ||||
-rw-r--r-- | hw/shix.c | 1 | ||||
-rw-r--r-- | hw/sun4m.c | 1 | ||||
-rw-r--r-- | hw/sun4u.c | 1 | ||||
-rw-r--r-- | vl.c | 16 |
11 files changed, 24 insertions, 3 deletions
diff --git a/hw/boards.h b/hw/boards.h index 3144017668..f6733b7cc9 100644 --- a/hw/boards.h +++ b/hw/boards.h @@ -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; diff --git a/hw/etraxfs.c b/hw/etraxfs.c index 27205ad579..f043c19d01 100644 --- a/hw/etraxfs.c +++ b/hw/etraxfs.c @@ -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) diff --git a/hw/integratorcp.c b/hw/integratorcp.c index ac0bd264ff..493866c92f 100644 --- a/hw/integratorcp.c +++ b/hw/integratorcp.c @@ -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) diff --git a/hw/mcf5208.c b/hw/mcf5208.c index 21b2bc8a4c..47a0f3eae0 100644 --- a/hw/mcf5208.c +++ b/hw/mcf5208.c @@ -290,6 +290,7 @@ static QEMUMachine mcf5208evb_machine = { .name = "mcf5208evb", .desc = "MCF5206EVB", .init = mcf5208evb_init, + .is_default = 1, }; static void mcf5208evb_machine_init(void) diff --git a/hw/mips_malta.c b/hw/mips_malta.c index eb81edf1c2..d8621824cb 100644 --- a/hw/mips_malta.c +++ b/hw/mips_malta.c @@ -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 = { diff --git a/hw/ppc_oldworld.c b/hw/ppc_oldworld.c index c6ec635ef8..377ed593a0 100644 --- a/hw/ppc_oldworld.c +++ b/hw/ppc_oldworld.c @@ -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) diff --git a/hw/sun4m.c b/hw/sun4m.c index 1c0f46729a..a2e02316e8 100644 --- a/hw/sun4m.c +++ b/hw/sun4m.c @@ -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 = { diff --git a/hw/sun4u.c b/hw/sun4u.c index 1ff0efa897..08789bccc1 100644 --- a/hw/sun4u.c +++ b/hw/sun4u.c @@ -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 != '?'); } |