From 89e069c5b2372c5185680c4e8248e460996846d4 Mon Sep 17 00:00:00 2001 From: Juan Quintela <quintela@redhat.com> Date: Thu, 31 Dec 2009 02:38:57 -0200 Subject: [PATCH 2/4] Add machine name alias support RH-Author: Juan Quintela <quintela@redhat.com> Message-id: <badb82f9d539e2a16820adc5075059ba2e457541.1262225896.git.quintela@redhat.com> Patchwork-id: 6026 O-Subject: [PATCH 1/3] Add machine name alias support Bugzilla: 553187 RH-Acked-by: Dor Laor <dlaor@redhat.com> RH-Acked-by: Michael S. Tsirkin <mst@redhat.com> RH-Acked-by: Marcelo Tosatti <mtosatti@redhat.com> based on upstream commit: commit 3f6599e675df86d89313e1ef7ce8edb8f7c2d039 Author: Mark McLoughlin <markmc@redhat.com> Date: Wed Jul 22 10:02:50 2009 +0100 Add machine type aliases Signed-off-by: Juan Quintela <quintela@redhat.com> --- qemu/hw/boards.h | 1 + qemu/vl.c | 5 +++++ 2 files changed, 6 insertions(+), 0 deletions(-) Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- qemu/hw/boards.h | 1 + qemu/vl.c | 5 +++++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/qemu/hw/boards.h b/qemu/hw/boards.h index 60b42af..ee6e6f5 100644 --- a/qemu/hw/boards.h +++ b/qemu/hw/boards.h @@ -17,6 +17,7 @@ typedef struct DeviceVersion { typedef struct QEMUMachine { const char *name; + const char *alias; const char *desc; QEMUMachineInitFunc *init; #define RAMSIZE_FIXED (1 << 0) diff --git a/qemu/vl.c b/qemu/vl.c index 25197f1..621c027 100644 --- a/qemu/vl.c +++ b/qemu/vl.c @@ -3669,6 +3669,8 @@ 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; } @@ -5299,6 +5301,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, m == first_machine ? " (default)" : ""); -- 1.6.3.rc4.29.g8146