]> git.proxmox.com Git - qemu.git/commitdiff
Introduce is_default field for QEMUMachine
authorAnthony Liguori <aliguori@us.ibm.com>
Fri, 22 May 2009 01:41:01 +0000 (20:41 -0500)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 22 May 2009 01:54:40 +0000 (20:54 -0500)
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>
hw/boards.h
hw/etraxfs.c
hw/integratorcp.c
hw/mcf5208.c
hw/mips_malta.c
hw/pc.c
hw/ppc_oldworld.c
hw/shix.c
hw/sun4m.c
hw/sun4u.c
vl.c

index 31440176685819a5fedf8914b339a4c62aa5e2f4..f6733b7cc9e21e5f944201dd8070a8853b200574 100644 (file)
@@ -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;
 
index 27205ad57966ca21a8722fc4c5f7eb82507027ef..f043c19d017defed624db42c6063f6939876de32 100644 (file)
@@ -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)
index ac0bd264ff6e59be5becf8f58d9e47c7d4015e62..493866c92faf35d85becfc2776501e87bdc1bac5 100644 (file)
@@ -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)
index 21b2bc8a4ce49edd3c9ab0e6731d77375bbd09ab..47a0f3eae0c7171a7120a32edf3c44955c8f267c 100644 (file)
@@ -290,6 +290,7 @@ static QEMUMachine mcf5208evb_machine = {
     .name = "mcf5208evb",
     .desc = "MCF5206EVB",
     .init = mcf5208evb_init,
+    .is_default = 1,
 };
 
 static void mcf5208evb_machine_init(void)
index eb81edf1c2bfe773bfed6e43c18b0a7f570b29bd..d8621824cbaecf3f30b68139f21c6817b4aeb682 100644 (file)
@@ -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)
diff --git a/hw/pc.c b/hw/pc.c
index 43b739146be1be4fc1f680fba37ef106d73fe6c2..e9682fadf2f6ea01c98dd6b9b9ae4a3207032a36 100644 (file)
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -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 = {
index c6ec635ef84ecdb61f9d140d61cb1709329308cf..377ed593a03a343d81f6e1465f37fe26aad1dd0a 100644 (file)
@@ -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)
index eeee6bbc43457d8d44f29f9b3c7d9e8df294b0d1..19b0155a49a86c49a270f49fe888011076aff98e 100644 (file)
--- a/hw/shix.c
+++ b/hw/shix.c
@@ -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)
index 1c0f46729a665fe73061017d7b2bde63a9bbd7f4..a2e02316e8f7826e218d7fa98db7b24f5547a7e8 100644 (file)
@@ -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 = {
index 1ff0efa8976b17bbe082480cd3c958f42dd9ea34..08789bccc1a7a66b4ca6e9f2487afe04adbeeaee 100644 (file)
@@ -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 = {
diff --git a/vl.c b/vl.c
index a0ce977b7a3437ff01f495d159b505387129106f..a24692c42837bb8f56d154d842dec6f3b2aa1c24 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -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 != '?');
                 }