[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/2] Add machine type aliases
From: |
Mark McLoughlin |
Subject: |
[Qemu-devel] [PATCH 1/2] Add machine type aliases |
Date: |
Wed, 22 Jul 2009 10:02:50 +0100 |
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 <address@hidden>
---
hw/boards.h | 1 +
vl.c | 5 +++++
2 files changed, 6 insertions(+), 0 deletions(-)
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 f475693..02d5da5 100644
--- a/vl.c
+++ b/vl.c
@@ -3357,6 +3357,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;
}
@@ -4993,6 +4995,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)" : "");
--
1.6.2.5
- [Qemu-devel] [PATCH 2/4] Remove the virtio-{blk, console}-pci-0-10 device types, (continued)
- [Qemu-devel] [PATCH 2/4] Remove the virtio-{blk, console}-pci-0-10 device types, Mark McLoughlin, 2009/07/21
- [Qemu-devel] [PATCH 3/4] Add machine type aliases, Mark McLoughlin, 2009/07/21
- [Qemu-devel] [PATCH 1/4] Remove the pc-0-10 machine type, Mark McLoughlin, 2009/07/21
- Re: [Qemu-devel] [PATCH 1/4] Remove the pc-0-10 machine type, Mark McLoughlin, 2009/07/21
- Re: [Qemu-devel] [PATCH 1/4] Remove the pc-0-10 machine type, Anthony Liguori, 2009/07/21
- Re: [Qemu-devel] [PATCH 1/4] Remove the pc-0-10 machine type, Gerd Hoffmann, 2009/07/22
- Re: [Qemu-devel] [PATCH 1/4] Remove the pc-0-10 machine type, Mark McLoughlin, 2009/07/22
- Re: [Qemu-devel] [PATCH 1/4] Remove the pc-0-10 machine type, Mark McLoughlin, 2009/07/22
- [Qemu-devel] [PATCH 2/2] Add a pc-0.11 machine type and make the pc type an alias, Mark McLoughlin, 2009/07/22
- Re: [Qemu-devel] [PATCH 2/2] Add a pc-0.11 machine type and make the pc type an alias, Mark McLoughlin, 2009/07/23
- [Qemu-devel] [PATCH 1/2] Add machine type aliases,
Mark McLoughlin <=
- [Qemu-devel] [PATCH 0/4] Add pc-0.11 machine type and make pc an alias to it, Mark McLoughlin, 2009/07/21
- [Qemu-devel] [PATCH 4/4] Add a pc-0.11 machine type and make the pc type an alias, Mark McLoughlin, 2009/07/21
- Re: [Qemu-devel] [PATCH 3/3 v2] Add a pc-0-10 machine type for compatibility with 0.10.x, Avi Kivity, 2009/07/09
- Re: [Qemu-devel] [PATCH 2/3] Change default PCI class of virtio-console to PCI_CLASS_SERIAL_OTHER, Amit Shah, 2009/07/15