diff options
author | Mark McLoughlin <markmc@redhat.com> | 2009-07-22 10:02:50 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-07-27 08:39:28 -0500 |
commit | 3f6599e675df86d89313e1ef7ce8edb8f7c2d039 (patch) | |
tree | 507ca1b2de9eeead58d8589bddbac894b18ade90 /vl.c | |
parent | c1d6eed7e85f5cfae9c548e58971db657237050a (diff) |
Add machine type aliases
Add an 'alias' field to QEMUMachine and display it in the output of
'qemu -M ?' with an '(aliased to foo)' suffix.
Aliases can change targets in newer versions of qemu, so management tools
may choose canonicalize machine types to ensure that if a user chooses an
alias, that the actual machine type used will remain compatible in
future.
This is intended to mimic a symlink to a machine description file.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -3359,6 +3359,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; } @@ -4995,6 +4997,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->is_default ? " (default)" : ""); |