[prev in list] [next in list] [prev in thread] [next in thread]
List: qemu-commits
Subject: [Qemu-commits] [COMMIT 3f6599e] Add machine type aliases
From: Anthony Liguori <aliguori () us ! ibm ! com>
Date: 2009-07-27 19:23:11
Message-ID: 200907271922.n6RJMm0W021742 () d01av01 ! pok ! ibm ! com
[Download RAW message or body]
From: Mark McLoughlin <markmc@redhat.com>
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>
diff --git a/hw/boards.h b/hw/boards.h
index 11acb89..d889341 100644
--- a/hw/boards.h
+++ b/hw/boards.h
@@ -14,6 +14,7 @@ typedef void QEMUMachineInitFunc(ram_addr_t ram_size,
typedef struct QEMUMachine {
const char *name;
+ const char *alias;
const char *desc;
QEMUMachineInitFunc *init;
int use_scsi;
diff --git a/vl.c b/vl.c
index ce213c2..3fff64a 100644
--- a/vl.c
+++ b/vl.c
@@ -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)" : "");
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic