Patchwork [17/22] machine: kill machine->alias

login
register
mail settings
Submitter Anthony Liguori
Date June 7, 2010, 11:52 p.m.
Message ID <1275954730-8196-18-git-send-email-aliguori@us.ibm.com>
Download mbox | patch
Permalink /patch/54908/
State New
Headers show

Comments

Anthony Liguori - June 7, 2010, 11:52 p.m.
Just duplicate the machine structure for now

Patch

diff --git a/hw/boards.h b/hw/boards.h
index b99dc68..a4dde9f 100644
--- a/hw/boards.h
+++ b/hw/boards.h
@@ -11,7 +11,6 @@  typedef void QEMUMachineInitFunc(QemuOpts *opts);
 
 struct QEMUMachine {
     const char *name;
-    const char *alias;
     const char *desc;
     QEMUMachineInitFunc *init;
     QemuOptDesc *opts_desc;
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 1bb6bee..e043942 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -182,8 +182,21 @@  static QemuOptDesc pc_opts_desc[] = {
 #endif
 
 static QEMUMachine pc_machine = {
+    .name = "pc",
+    .desc = "Standard PC",
+    .init = pc_init,
+    .opts_desc = pc_opts_desc,
+    .opts_default = (QemuOptValue[]) {
+        QOPT_VALUE("acpi", "on"),
+        QOPT_VALUE("pci", "on"),
+        QOPT_VALUE("cpu", PC_DEFAULT_CPU_MODEL),
+        QOPT_VALUE("max_cpus", "255"),
+        { /* end of list */ }
+    },
+};
+
+static QEMUMachine pc_machine_v0_13 = {
     .name = "pc-0.13",
-    .alias = "pc",
     .desc = "Standard PC",
     .init = pc_init,
     .opts_desc = pc_opts_desc,
@@ -272,6 +285,7 @@  static QEMUMachine isapc_machine = {
 static void pc_machine_init(void)
 {
     qemu_register_machine(&pc_machine);
+    qemu_register_machine(&pc_machine_v0_13);
     qemu_register_machine(&pc_machine_v0_12);
     qemu_register_machine(&pc_machine_v0_11);
     qemu_register_machine(&pc_machine_v0_10);
diff --git a/hw/ppc440_bamboo.c b/hw/ppc440_bamboo.c
index 8ed4632..1650a17 100644
--- a/hw/ppc440_bamboo.c
+++ b/hw/ppc440_bamboo.c
@@ -173,8 +173,13 @@  static void bamboo_init(QemuOpts *opts)
 }
 
 static QEMUMachine bamboo_machine = {
+    .name = "bamboo",
+    .desc = "bamboo",
+    .init = bamboo_init,
+};
+
+static QEMUMachine bamboo_machine_v0_13 = {
     .name = "bamboo-0.13",
-    .alias = "bamboo",
     .desc = "bamboo",
     .init = bamboo_init,
 };
@@ -198,6 +203,7 @@  static QEMUMachine bamboo_machine_v0_12 = {
 static void bamboo_machine_init(void)
 {
     qemu_register_machine(&bamboo_machine);
+    qemu_register_machine(&bamboo_machine_v0_13);
     qemu_register_machine(&bamboo_machine_v0_12);
 }
 
diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c
index 6c0f400..fd1fe52 100644
--- a/hw/s390-virtio.c
+++ b/hw/s390-virtio.c
@@ -269,8 +269,21 @@  static void s390_init(QemuOpts *opts)
 }
 
 static QEMUMachine s390_machine = {
+    .name = "s390",
+    .desc = "VirtIO based S390 machine",
+    .init = s390_init,
+    .opts_default = (QemuOptValue[]) {
+        QOPT_VALUE("serial", "off"),
+        QOPT_VALUE("parallel", "off"),
+        QOPT_VALUE("virtcon", "on"),
+        QOPT_VALUE("vga", "off"),
+        QOPT_VALUE("max_cpus", "255"),
+        { /* end of list */ }
+    },
+};
+
+static QEMUMachine s390_virtio_machine = {
     .name = "s390-virtio",
-    .alias = "s390",
     .desc = "VirtIO based S390 machine",
     .init = s390_init,
     .opts_default = (QemuOptValue[]) {
@@ -286,7 +299,8 @@  static QEMUMachine s390_machine = {
 static void s390_machine_init(void)
 {
     qemu_register_machine(&s390_machine);
-    machine_set_default("s390-virtio");
+    qemu_register_machine(&s390_virtio_machine);
+    machine_set_default("s390");
 }
 
 machine_init(s390_machine_init);
diff --git a/vl.c b/vl.c
index 3d49ba7..8fc89c1 100644
--- a/vl.c
+++ b/vl.c
@@ -1616,8 +1616,6 @@  static QEMUMachine *find_machine(const char *name)
     for(m = first_machine; m != NULL; m = m->next) {
         if (!strcmp(m->name, name))
             return m;
-        if (m->alias && !strcmp(m->alias, name))
-            return m;
     }
     return NULL;
 }
@@ -2758,13 +2756,9 @@  int main(int argc, char **argv, char **envp)
                     QEMUMachine *m;
                     printf("Supported machines are:\n");
                     for(m = first_machine; m != NULL; m = m->next) {
-                        if (m->alias)
-                            printf("%-10s %s (alias of %s)\n",
-                                   m->alias, m->desc, m->name);
                         printf("%-10s %s%s\n",
                                m->name, m->desc,
-                               (!strcmp(m->name, default_machine) ||
-                                !strcmp(m->alias, default_machine)) ? 
+                               !strcmp(m->name, default_machine) ?
                                " (default)" : "");
                     }
                     exit(0);